Data: Fix NPE in debug logging

This commit is contained in:
zzz
2019-03-04 17:17:44 +00:00
parent 5d3b7c1c53
commit f1ed870a4a
3 changed files with 14 additions and 7 deletions

View File

@ -600,9 +600,12 @@ public class EncryptedLeaseSet extends LeaseSet2 {
public String toString() {
StringBuilder buf = new StringBuilder(128);
buf.append("[EncryptedLeaseSet: ");
buf.append("\n\tBlinded Key: ").append(_signingKey);
buf.append("\n\tHash: ").append(getHash());
buf.append("\n\tB32: ").append(getHash().toBase32());
if (_signingKey != null) {
buf.append("\n\tBlinded Key: ").append(_signingKey);
Hash h = getHash();
buf.append("\n\tHash: ").append(h);
buf.append("\n\tB32: ").append(h.toBase32());
}
if (isOffline()) {
buf.append("\n\tTransient Key: ").append(_transientSigningPublicKey);
buf.append("\n\tTransient Expires: ").append(new java.util.Date(_transientExpires));

View File

@ -401,8 +401,10 @@ public class LeaseSet extends DatabaseEntry {
public String toString() {
StringBuilder buf = new StringBuilder(128);
buf.append("[LeaseSet: ");
buf.append("\n\tDestination: ").append(_destination);
buf.append("\n\tB32: ").append(_destination.toBase32());
if (_destination != null) {
buf.append("\n\tDestination: ").append(_destination);
buf.append("\n\tB32: ").append(_destination.toBase32());
}
buf.append("\n\tEncryptionKey: ").append(_encryptionKey);
buf.append("\n\tSigningKey: ").append(_signingKey);
buf.append("\n\tSignature: ").append(_signature);

View File

@ -603,8 +603,10 @@ public class LeaseSet2 extends LeaseSet {
public String toString() {
StringBuilder buf = new StringBuilder(128);
buf.append("[LeaseSet2: ");
buf.append("\n\tDestination: ").append(_destination);
buf.append("\n\tB32: ").append(_destination.toBase32());
if (_destination != null) {
buf.append("\n\tDestination: ").append(_destination);
buf.append("\n\tB32: ").append(_destination.toBase32());
}
List<PublicKey> keys = getEncryptionKeys();
int sz = keys.size();
buf.append("\n\tEncryption Keys: ").append(sz);