From 0b2bc726df4adf58fef4083813a3e3b587059684 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sat, 4 Dec 2010 21:18:37 +0000
Subject: [PATCH] fix SimpleSession NPE

---
 core/java/src/net/i2p/client/I2PSessionImpl.java   | 4 +++-
 core/java/src/net/i2p/client/I2PSimpleSession.java | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/java/src/net/i2p/client/I2PSessionImpl.java b/core/java/src/net/i2p/client/I2PSessionImpl.java
index 9943d16ec9..4b65d422b0 100644
--- a/core/java/src/net/i2p/client/I2PSessionImpl.java
+++ b/core/java/src/net/i2p/client/I2PSessionImpl.java
@@ -659,7 +659,9 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
                 propogateError("Error destroying the session", ipe);
             }
         }
-        _availabilityNotifier.stopNotifying();
+        // SimpleSession does not initialize
+        if (_availabilityNotifier != null)
+            _availabilityNotifier.stopNotifying();
         _closed = true;
         _closing = false;
         closeSocket();
diff --git a/core/java/src/net/i2p/client/I2PSimpleSession.java b/core/java/src/net/i2p/client/I2PSimpleSession.java
index dac914d646..4f15c16ff7 100644
--- a/core/java/src/net/i2p/client/I2PSimpleSession.java
+++ b/core/java/src/net/i2p/client/I2PSimpleSession.java
@@ -47,6 +47,7 @@ class I2PSimpleSession extends I2PSessionImpl2 {
      * @throws I2PSessionException if there is a problem
      */
     public I2PSimpleSession(I2PAppContext context, Properties options) throws I2PSessionException {
+        // Warning, does not call super()
         _context = context;
         _log = context.logManager().getLog(I2PSimpleSession.class);
         _handlerMap = new SimpleMessageHandlerMap(context);
-- 
GitLab