Summary: [net] NullpointerException on FTPClient.disconnect() if
an Exception occured while FTPClient.connect
Version: 1.2 Final
AssignedTo: [hidden email] ReportedBy: [hidden email]
Versions affected: commons-net-1.2.2, think also commons-net-1.4.0
Problem: If an exception occures while FTPClient.connect() is running, a call to
FTPClient.disconnect() in a finally-block might throw a NullPointerException.
I am pretty shure, that this might cause some Threads so keep alive, also they
cannot be interrupted anymore.
Reason: This happens since TelnetClient.disconnect() does not check whether the
Streams (__input and __ouput) it tries to close are NULL or not.
Normally it is sufficent to check FTPClient.isConnected(), but if a exceptions
is thrown after SocketClient.__connectAction_ has been excecuted, SocketClient.
_isConnected_ is set to true, so the check will indicate that the connection is