IDEA-163617 Project view throws exception and becomes unavailable until IDE is restarted
authorKonstantin Bulenkov <kb@jetbrains.com>
Mon, 7 Nov 2016 23:23:54 +0000 (02:23 +0300)
committerKonstantin Bulenkov <kb@jetbrains.com>
Mon, 7 Nov 2016 23:23:54 +0000 (02:23 +0300)
platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java

index 8b37120fcade4102c3e88002f83f3eea702bdc95..14b31104c7b99ddf680f914a6c2da8f6f592fbd8 100644 (file)
@@ -1700,8 +1700,10 @@ public class ProjectViewImpl extends ProjectView implements PersistentStateCompo
     }
 
     private void selectElementAtCaretNotLosingFocus(@NotNull Editor editor) {
-      if (IJSwingUtilities.hasFocus(getCurrentProjectViewPane().getComponentToFocus())) return;
-      selectElementAtCaret(editor);
+      AbstractProjectViewPane pane = getCurrentProjectViewPane();
+      if (pane != null && !IJSwingUtilities.hasFocus(pane.getComponentToFocus())) {
+        selectElementAtCaret(editor);
+      }
     }
 
     private void selectElementAtCaret(@NotNull Editor editor) {