From 12cba6310e30a4aea466b13c258b92347ac4d26d Mon Sep 17 00:00:00 2001 From: Eugene Kudelevsky Date: Sat, 13 Nov 2010 20:07:09 +0300 Subject: [PATCH] fix Android test running under linux --- .../jetbrains/android/facet/AndroidRootUtil.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/android/src/org/jetbrains/android/facet/AndroidRootUtil.java b/plugins/android/src/org/jetbrains/android/facet/AndroidRootUtil.java index e63fa861d677..cb107ed732c7 100644 --- a/plugins/android/src/org/jetbrains/android/facet/AndroidRootUtil.java +++ b/plugins/android/src/org/jetbrains/android/facet/AndroidRootUtil.java @@ -74,17 +74,18 @@ public class AndroidRootUtil { @Nullable public static VirtualFile getFileByRelativeModulePath(Module module, String relativePath, boolean lookInContentRoot) { String moduleDirPath = new File(module.getModuleFilePath()).getParent(); - if (moduleDirPath == null) return null; - String absPath = FileUtil.toSystemIndependentName(moduleDirPath + relativePath); - VirtualFile file = LocalFileSystem.getInstance().findFileByPath(absPath); - if (file != null) { - return file; + if (moduleDirPath != null) { + String absPath = FileUtil.toSystemIndependentName(moduleDirPath + relativePath); + VirtualFile file = LocalFileSystem.getInstance().findFileByPath(absPath); + if (file != null) { + return file; + } } if (lookInContentRoot) { for (VirtualFile contentRoot : ModuleRootManager.getInstance(module).getContentRoots()) { - absPath = FileUtil.toSystemIndependentName(contentRoot.getPath() + relativePath); - file = LocalFileSystem.getInstance().findFileByPath(absPath); + String absPath = FileUtil.toSystemIndependentName(contentRoot.getPath() + relativePath); + VirtualFile file = LocalFileSystem.getInstance().findFileByPath(absPath); if (file != null) { return file; }