Check for 'null' to avoid NPE in Socks5Proxy

Check if serverSocket is null before calling isClosed(), as otherwise
the resulting NPE will cause an endless loop.

Thanks to Michael Grafl for reporting.

Fixes SMACK-707.
This commit is contained in:
Florian Schmaus 2015-12-10 17:10:49 +01:00
parent 352e422562
commit f34f37a20c
1 changed files with 1 additions and 1 deletions

View File

@ -387,7 +387,7 @@ public class Socks5Proxy {
try {
if (Socks5Proxy.this.serverSocket.isClosed()
if (Socks5Proxy.this.serverSocket == null || Socks5Proxy.this.serverSocket.isClosed()
|| Thread.currentThread().isInterrupted()) {
return;
}