Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2018-10-18 11:23:41 -0400
committerAndrey Loskutov2018-10-18 11:23:41 -0400
commitd8657b2563bda1f90eaf30ef36df09681eb1d39b (patch)
tree7c9edb13911edfc3f4f28e15e8cd870a8d7085ec
parent024978ca0eb7ef7c46a1c561e2f09a047c49643f (diff)
downloadeclipse.platform.debug-d8657b2563bda1f90eaf30ef36df09681eb1d39b.tar.gz
eclipse.platform.debug-d8657b2563bda1f90eaf30ef36df09681eb1d39b.tar.xz
eclipse.platform.debug-d8657b2563bda1f90eaf30ef36df09681eb1d39b.zip
Bug 540259 - NPE in ProcessConsole$InputReadJob.runI20181019-0450I20181019-0330I20181018-1800
Change-Id: Ib4c5510e95e2d707e9b649c010cc6d16ffe01609 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java10
1 files changed, 7 insertions, 3 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 2eba11757..69c8bb9fb 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
@@ -101,7 +101,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
private IConsoleColorProvider fColorProvider;
- private InputStream fInput;
+ private volatile InputStream fInput;
private FileOutputStream fFileOutputStream;
@@ -729,8 +729,12 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
try {
byte[] b = new byte[1024];
int read = 0;
- while (fInput != null && read >= 0) {
- read = fInput.read(b);
+ while (read >= 0) {
+ InputStream input = fInput;
+ if (input == null) {
+ break;
+ }
+ read = input.read(b);
if (read > 0) {
String s;
if (encoding != null) {

Back to the top