Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.6
-
None
-
Observed in Android application. Some people encountered similar NPE on desktop years ago:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=395149
Description
our code:
try { TelnetClient telnetClient = new TelnetClient(); telnetClient.connect(address, port); mInput = new BufferedInputStream(telnetClient.getInputStream()); mOutput = new PrintStream(telnetClient.getOutputStream()); BufferedReader br = new BufferedReader(new InputStreamReader(this.mInput)); ... some IO on streams ... } catch (IOException e) { if (Dbg.DEBUG) { Dbg.d(TAG, "telnet exception " + Dbg.getStackTraceString(e)); } return false; } finally { try { if (mInput != null) mInput.close(); if (mOutput != null) mOutput.close(); } catch (IOException ignored) {} }