Changeset 1f702f1e


Ignore:
Timestamp:
Feb 13, 2011 8:28:46 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
38bfca1
Parents:
41d8177
Message:
  • JobQueue?: Prevet NPE at shutdown (thanks liberty)
File:
1 edited

Legend:

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

    r41d8177 r1f702f1e  
    228228
    229229    public long getMaxLag() {
     230            // first job is the one that has been waiting the longest
    230231            Job j = _readyJobs.peek();
    231232            if (j == null) return 0;
    232             // first job is the one that has been waiting the longest
    233             long startAfter = j.getTiming().getStartAfter();
     233            JobTiming jt = j.getTiming();
     234            // PoisonJob timing is null, prevent NPE at shutdown
     235            if (jt == null)
     236                return 0;
     237            long startAfter = jt.getStartAfter();
    234238            return _context.clock().now() - startAfter;
    235239    }
Note: See TracChangeset for help on using the changeset viewer.