mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
psi viewer fix possible npe
This commit is contained in:
+5
-1
@@ -257,7 +257,10 @@ public class BlockViewerPsiBasedTree implements ViewerPsiBasedTree {
|
||||
return null;
|
||||
}
|
||||
|
||||
BlockTreeNode node = (BlockTreeNode)getRoot().getUserObject();
|
||||
DefaultMutableTreeNode root = getRoot();
|
||||
if (root == null) return null;
|
||||
|
||||
BlockTreeNode node = (BlockTreeNode)root.getUserObject();
|
||||
main_loop:
|
||||
while (true) {
|
||||
if (node.getBlock().getTextRange().equals(range)) {
|
||||
@@ -316,6 +319,7 @@ public class BlockViewerPsiBasedTree implements ViewerPsiBasedTree {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode getRoot() {
|
||||
return (DefaultMutableTreeNode)myBlockTree.getModel().getRoot();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user