From b0ec58807213c8a669b664b0f9909c928e7f887e Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Mon, 17 Jun 2019 14:22:38 +0300 Subject: [PATCH] EA-144968 - NPE: UpdateInfoTree.getSelectedFilePointer GitOrigin-RevId: 96a84e3a476fcc03e06df47c88b9d2d585f5b27b --- .../src/com/intellij/openapi/vcs/update/UpdateInfoTree.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java index b23f018db93c..c766e337cb32 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/update/UpdateInfoTree.java @@ -316,7 +316,9 @@ public class UpdateInfoTree extends PanelWithActionsAndCloseButton { @Nullable private VirtualFilePointer getSelectedFilePointer() { - AbstractTreeNode treeNode = (AbstractTreeNode)myTree.getSelectionPath().getLastPathComponent(); + TreePath path = myTree.getSelectionPath(); + if (path == null) return null; + AbstractTreeNode treeNode = (AbstractTreeNode)path.getLastPathComponent(); return treeNode instanceof FileTreeNode ? ((FileTreeNode)treeNode).getFilePointer() : null; }