From bcd063970c1ed2cc5d1eced598c2ce8b12af1b9c Mon Sep 17 00:00:00 2001 From: "Vladislav.Soroka" Date: Wed, 18 Sep 2013 15:08:13 +0400 Subject: [PATCH] EA-49794 - NPE fix --- .../gradle/service/project/GradleAutoImportAware.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleAutoImportAware.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleAutoImportAware.java index ca748ed7c762..6c8a5308ddc5 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleAutoImportAware.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleAutoImportAware.java @@ -52,7 +52,12 @@ public class GradleAutoImportAware implements ExternalSystemAutoImportAware { } Map rootPaths = ContainerUtilRt.newHashMap(); for (ExternalProjectSettings setting : projectsSettings) { - rootPaths.put(new File(setting.getExternalProjectPath()).getParentFile().getAbsolutePath(), setting.getExternalProjectPath()); + if(setting != null && setting.getExternalProjectPath() != null) { + File rootPath = new File(setting.getExternalProjectPath()); + if(rootPath.getParentFile() != null) { + rootPaths.put(rootPath.getParentFile().getAbsolutePath(), setting.getExternalProjectPath()); + } + } } for (File f = new File(changedFileOrDirPath).getParentFile(); f != null; f = f.getParentFile()) {