Changeset 75d681a9 for router


Ignore:
Timestamp:
Apr 23, 2018 3:48:44 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
18b11d2
Parents:
0500bbb
Message:

Clock: Fix early NPE via DoH

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterClock.java

    r0500bbb r75d681a9  
    151151
    152152                // Try calculating peer clock skew
    153                 long currentPeerClockSkew = ((RouterContext)_context).commSystem().getFramedAveragePeerClockSkew(33);
     153                // This may get called very early at startup, before RouterContext.initAll() is completed,
     154                // so the comm system may be null. Avoid NPE.
     155                CommSystemFacade csf = ((RouterContext)_context).commSystem();
     156                long currentPeerClockSkew = (csf != null) ? csf.getFramedAveragePeerClockSkew(33) : 0;
    154157
    155158                    // Predict the effect of applying the proposed clock offset
Note: See TracChangeset for help on using the changeset viewer.