Skip to content

Commit

Permalink
Issue #4317 - fix for NPE in Socks5ConnectionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
hantu85 committed Jul 5, 2016
1 parent e22dc08 commit 7525386
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@
*/
package tigase.jaxmpp.j2se.connection.socks5bytestream;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;

import tigase.jaxmpp.core.client.*;
import tigase.jaxmpp.core.client.XMPPException.ErrorCondition;
import tigase.jaxmpp.core.client.exceptions.JaxmppException;
Expand All @@ -49,6 +34,21 @@
import tigase.jaxmpp.j2se.filetransfer.FileTransfer;
import tigase.jaxmpp.j2se.filetransfer.FileTransferManager;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
*
* @author andrzej
Expand Down Expand Up @@ -334,7 +334,9 @@ protected static void unregisterSession(ConnectionSession session) {
sessions.remove(hash);

if (sessions.isEmpty()) {
server.shutdown();
if (server != null) {
server.shutdown();
}
}
}
}
Expand Down

0 comments on commit 7525386

Please sign in to comment.