Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2019-01-25 07:33:08 -0500
committerAndrey Loskutov2019-01-25 07:33:08 -0500
commite9ea279fb48b3e243a9fff507edfb0d50feb45a6 (patch)
tree4fdd33988eb5e8f1104f2d26e03fc3a302452c1b
parent74e2e1ce5dcf9a60d61410f1634fa6044197b479 (diff)
downloadeclipse.platform.debug-e9ea279fb48b3e243a9fff507edfb0d50feb45a6.tar.gz
eclipse.platform.debug-e9ea279fb48b3e243a9fff507edfb0d50feb45a6.tar.xz
eclipse.platform.debug-e9ea279fb48b3e243a9fff507edfb0d50feb45a6.zip
Bug 543832 - NPE in ProcessConsole.getStream()
Reordered stream disposal and disconnecting of listeners, so that listener should not run on disposed streams. Change-Id: I895f580c7eaca746994bd78f31ea82c62bfddffd Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
index 69c8bb9fb..879e806ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
@@ -360,13 +360,13 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
}
}
- /**
- * @see org.eclipse.debug.ui.console.IConsole#getStream(java.lang.String)
- */
@Override
public IOConsoleOutputStream getStream(String streamIdentifier) {
+ if (streamIdentifier == null) {
+ return null;
+ }
for (StreamListener listener : fStreamListeners) {
- if (listener.fStreamId.equals(streamIdentifier)) {
+ if (streamIdentifier.equals(listener.fStreamId)) {
return listener.fStream;
}
}
@@ -388,11 +388,11 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
protected void dispose() {
super.dispose();
fColorProvider.disconnect();
- closeStreams();
- disposeStreams();
DebugPlugin.getDefault().removeDebugEventListener(this);
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
JFaceResources.getFontRegistry().removeListener(this);
+ closeStreams();
+ disposeStreams();
}
/**

Back to the top