Changeset f1ed870 for core


Ignore:
Timestamp:
Mar 4, 2019 5:17:44 PM (13 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ad1600e
Parents:
5d3b7c1
Message:

Data: Fix NPE in debug logging

Location:
core/java/src/net/i2p/data
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/EncryptedLeaseSet.java

    r5d3b7c1 rf1ed870  
    601601        StringBuilder buf = new StringBuilder(128);
    602602        buf.append("[EncryptedLeaseSet: ");
    603         buf.append("\n\tBlinded Key: ").append(_signingKey);
    604         buf.append("\n\tHash: ").append(getHash());
    605         buf.append("\n\tB32: ").append(getHash().toBase32());
     603        if (_signingKey != null) {
     604            buf.append("\n\tBlinded Key: ").append(_signingKey);
     605            Hash h = getHash();
     606            buf.append("\n\tHash: ").append(h);
     607            buf.append("\n\tB32: ").append(h.toBase32());
     608        }
    606609        if (isOffline()) {
    607610            buf.append("\n\tTransient Key: ").append(_transientSigningPublicKey);
  • core/java/src/net/i2p/data/LeaseSet.java

    r5d3b7c1 rf1ed870  
    402402        StringBuilder buf = new StringBuilder(128);
    403403        buf.append("[LeaseSet: ");
    404         buf.append("\n\tDestination: ").append(_destination);
    405         buf.append("\n\tB32: ").append(_destination.toBase32());
     404        if (_destination != null) {
     405            buf.append("\n\tDestination: ").append(_destination);
     406            buf.append("\n\tB32: ").append(_destination.toBase32());
     407        }
    406408        buf.append("\n\tEncryptionKey: ").append(_encryptionKey);
    407409        buf.append("\n\tSigningKey: ").append(_signingKey);
  • core/java/src/net/i2p/data/LeaseSet2.java

    r5d3b7c1 rf1ed870  
    604604        StringBuilder buf = new StringBuilder(128);
    605605        buf.append("[LeaseSet2: ");
    606         buf.append("\n\tDestination: ").append(_destination);
    607         buf.append("\n\tB32: ").append(_destination.toBase32());
     606        if (_destination != null) {
     607            buf.append("\n\tDestination: ").append(_destination);
     608            buf.append("\n\tB32: ").append(_destination.toBase32());
     609        }
    608610        List<PublicKey> keys = getEncryptionKeys();
    609611        int sz = keys.size();
Note: See TracChangeset for help on using the changeset viewer.