Changeset e29e3e2 for router


Ignore:
Timestamp:
Feb 11, 2017 1:26:26 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
c949d77
Parents:
e01c443
Message:

Test: Prevent NPE in LocalClientManager? test on client shutdown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/client/ClientConnectionRunner.java

    re01c443 re29e3e2  
    200200            _sessionKeyManager.shutdown();
    201201        _manager.unregisterConnection(this);
    202         for (SessionParams sp : _sessions.values()) {
    203             LeaseSet ls = sp.currentLeaseSet;
    204             if (ls != null)
    205                 _context.netDb().unpublish(ls);
    206             if (!sp.isPrimary)
    207                 _context.tunnelManager().removeAlias(sp.dest);
     202        // netdb may be null in unit tests
     203        if (_context.netDb() != null) {
     204            for (SessionParams sp : _sessions.values()) {
     205                LeaseSet ls = sp.currentLeaseSet;
     206                if (ls != null)
     207                    _context.netDb().unpublish(ls);
     208                if (!sp.isPrimary)
     209                    _context.tunnelManager().removeAlias(sp.dest);
     210            }
    208211        }
    209212        synchronized (_alreadyProcessed) {
Note: See TracChangeset for help on using the changeset viewer.