From babd6e8db03622a4628ee9ab761238e9813f6a45 Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Thu, 1 Oct 2015 19:12:26 -0300 Subject: [PATCH] Bug 478858 - TelnetProtocol#run() remove null pointer occurrences. When terminating command shell some I/O stream might be null. Change-Id: I03ed30f7869f499fb4b62b978d689ffb99b1eac4 Signed-off-by: Wainer dos Santos Moschetta --- .../eclipse/remote/telnet/core/TelnetProtocol.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/TelnetProtocol.java b/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/TelnetProtocol.java index 33fa15b8f7a..f334d4fcac2 100644 --- a/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/TelnetProtocol.java +++ b/bundles/org.eclipse.remote.telnet.core/src/org/eclipse/remote/telnet/core/TelnetProtocol.java @@ -359,17 +359,23 @@ public class TelnetProtocol extends Thread implements TelnetCodes { // Tell the command shell that we have terminated shell.terminated(); try { - inputChannel.close(); + if(inputChannel != null) { + inputChannel.close(); + } } catch (IOException ioe) { /* ignore */ } try { - serverOutputStream.close(); + if(serverOutputStream != null) { + serverOutputStream.close(); + } } catch (IOException ioe) { /* ignore */ } try { - clientOutputStream.close(); + if(clientOutputStream != null) { + clientOutputStream.close(); + } } catch (IOException ioe) { /* ignore */ }