I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 4f9c442d authored by zzz's avatar zzz
Browse files

fix disconnect race NPE

parent adab0cc3
No related branches found
No related tags found
No related merge requests found
......@@ -190,6 +190,7 @@ public class I2PSnarkUtil {
*/
public void disconnect() {
I2PSocketManager mgr = _manager;
// FIXME this can cause race NPEs elsewhere
_manager = null;
_shitlist.clear();
mgr.destroySocketManager();
......@@ -201,6 +202,9 @@ public class I2PSnarkUtil {
/** connect to the given destination */
I2PSocket connect(PeerID peer) throws IOException {
I2PSocketManager mgr = _manager;
if (mgr == null)
throw new IOException("No socket manager");
Destination addr = peer.getAddress();
if (addr == null)
throw new IOException("Null address");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment