From 4d41f2fd92323b9edf397156e0bdd8a4311524ff Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 31 Mar 2011 15:06:14 +0400 Subject: [PATCH] NPE fixed --- .../intellij/xdebugger/impl/XDebuggerManagerImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java index 464cf1ea52a6..8c063df04cb0 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerManagerImpl.java @@ -226,9 +226,13 @@ public class XDebuggerManagerImpl extends XDebuggerManager implements ProjectCom @Override @Nullable public XDebugSession getDebugSession(@NotNull ExecutionConsole executionConsole) { - for (final XDebugSession debuggerSession : getDebugSessions()) { - if (executionConsole == debuggerSession.getRunContentDescriptor().getExecutionConsole()) { - return debuggerSession; + for (final XDebugSessionImpl debuggerSession : mySessions.values()) { + XDebugSessionTab sessionTab = debuggerSession.getSessionTab(); + if (sessionTab != null) { + RunContentDescriptor contentDescriptor = sessionTab.getRunContentDescriptor(); + if (contentDescriptor != null && executionConsole == contentDescriptor.getExecutionConsole()) { + return debuggerSession; + } } } return null;