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

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

Test: Prevent NPE in LocalClientManager test on client shutdown

parent e01c443f
No related branches found
No related tags found
No related merge requests found
...@@ -199,12 +199,15 @@ class ClientConnectionRunner { ...@@ -199,12 +199,15 @@ class ClientConnectionRunner {
if (_sessionKeyManager != null) if (_sessionKeyManager != null)
_sessionKeyManager.shutdown(); _sessionKeyManager.shutdown();
_manager.unregisterConnection(this); _manager.unregisterConnection(this);
for (SessionParams sp : _sessions.values()) { // netdb may be null in unit tests
LeaseSet ls = sp.currentLeaseSet; if (_context.netDb() != null) {
if (ls != null) for (SessionParams sp : _sessions.values()) {
_context.netDb().unpublish(ls); LeaseSet ls = sp.currentLeaseSet;
if (!sp.isPrimary) if (ls != null)
_context.tunnelManager().removeAlias(sp.dest); _context.netDb().unpublish(ls);
if (!sp.isPrimary)
_context.tunnelManager().removeAlias(sp.dest);
}
} }
synchronized (_alreadyProcessed) { synchronized (_alreadyProcessed) {
_alreadyProcessed.clear(); _alreadyProcessed.clear();
......
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