diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java index 992371f8ff7e..585a80a574bc 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java @@ -136,52 +136,52 @@ public class XValueNodeImpl extends XValueContainerNode implements XValu public void updateInlineDebuggerData() { try { - final XDebugSession session = XDebugView.getSession(getTree()); - if (session != null) { - final XSourcePosition debuggerPosition = session.getCurrentPosition(); - if (debuggerPosition != null) { - final XInlineDebuggerDataCallback callback = new XInlineDebuggerDataCallback() { - @Override - public void computed(@NotNull VirtualFile file, @NotNull Document document, int line) { - final Map, Set> map = myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES); - final Map timestamps = myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES_TIMESTAMPS); - if (map == null || timestamps == null) { - return; - } + XDebugSession session = XDebugView.getSession(getTree()); + final XSourcePosition debuggerPosition = session == null ? null : session.getCurrentPosition(); + if (debuggerPosition == null) { + return; + } - Pair key = Pair.create(file, line); - Set presentations = new LinkedHashSet(); - Set old = map.put(key, presentations); - timestamps.put(file, document.getModificationStamp()); - presentations.add(XValueNodeImpl.this); - if (old != null) { - presentations.addAll(old); - } - myTree.updateEditor(); - } - }; + final XInlineDebuggerDataCallback callback = new XInlineDebuggerDataCallback() { + @Override + public void computed(@NotNull VirtualFile file, @NotNull Document document, int line) { + final Map, Set> map = myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES); + final Map timestamps = myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES_TIMESTAMPS); + if (map == null || timestamps == null) { + return; + } - if (getValueContainer().computeInlineDebuggerData(callback) == ThreeState.UNSURE) { - class ValueDeclaration implements XInlineSourcePosition { - @Override - public void setSourcePosition(@Nullable XSourcePosition sourcePosition) { - final Map, Set> map = - myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES); - final Map timestamps = myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES_TIMESTAMPS); - if (map == null || timestamps == null || sourcePosition == null) return; - VirtualFile file = sourcePosition.getFile(); - if (!Comparing.equal(debuggerPosition.getFile(), sourcePosition.getFile())) return; - final Document doc = FileDocumentManager.getInstance().getDocument(file); - if (doc == null) return; - int line = sourcePosition.getLine(); - callback.computed(file, doc, line); - } - } - class NearestValuePosition extends ValueDeclaration implements XNearestSourcePosition {} - getValueContainer().computeSourcePosition(new ValueDeclaration()); - getValueContainer().computeSourcePosition(new NearestValuePosition()); + Pair key = Pair.create(file, line); + Set presentations = new LinkedHashSet(); + Set old = map.put(key, presentations); + timestamps.put(file, document.getModificationStamp()); + presentations.add(XValueNodeImpl.this); + if (old != null) { + presentations.addAll(old); + } + myTree.updateEditor(); + } + }; + + if (getValueContainer().computeInlineDebuggerData(callback) == ThreeState.UNSURE) { + class ValueDeclaration implements XInlineSourcePosition { + @Override + public void setSourcePosition(@Nullable XSourcePosition sourcePosition) { + final Map, Set> map = + myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES); + final Map timestamps = myTree.getProject().getUserData(XVariablesView.DEBUG_VARIABLES_TIMESTAMPS); + if (map == null || timestamps == null || sourcePosition == null) return; + VirtualFile file = sourcePosition.getFile(); + if (!Comparing.equal(debuggerPosition.getFile(), sourcePosition.getFile())) return; + final Document doc = FileDocumentManager.getInstance().getDocument(file); + if (doc == null) return; + int line = sourcePosition.getLine(); + callback.computed(file, doc, line); } } + class NearestValuePosition extends ValueDeclaration implements XNearestSourcePosition {} + getValueContainer().computeSourcePosition(new ValueDeclaration()); + getValueContainer().computeSourcePosition(new NearestValuePosition()); } } catch (Exception ignore) {