Merge remote-tracking branch 'origin/master'
authorKonstantin Bulenkov <kb@jetbrains.com>
Mon, 7 Nov 2016 23:26:35 +0000 (02:26 +0300)
committerKonstantin Bulenkov <kb@jetbrains.com>
Mon, 7 Nov 2016 23:26:35 +0000 (02:26 +0300)
platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java

index ca3daa2dd274ac76d399d2ab620e66dfb6feb1e1..55e45c235803b089e1fe838bab33af7dd1d885ff 100644 (file)
@@ -1702,8 +1702,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) {