From 7a67b7f866e8064b5e07e2e7a65eab860a69363e Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Tue, 19 Apr 2011 16:27:01 +0200 Subject: [PATCH] fix NPE --- .../com/intellij/lang/ant/config/explorer/AntExplorer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java index 3650674cb5fc..d080fcb3b689 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorer.java @@ -93,7 +93,8 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider, } public boolean canExpand() { - return AntConfiguration.getInstance(myProject).getBuildFiles().length != 0; + final Project project = myProject; + return project != null && AntConfiguration.getInstance(project).getBuildFiles().length != 0; } public void collapseAll() { @@ -453,7 +454,7 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider, return HelpID.ANT; } else if (PlatformDataKeys.TREE_EXPANDER.is(dataId)) { - return myTreeExpander; + return myProject != null? myTreeExpander : null; } else if (PlatformDataKeys.VIRTUAL_FILE_ARRAY.is(dataId)) { final TreePath[] paths = myTree.getSelectionPaths();