mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-02 19:56:23 -04:00
Add null checks
This commit is contained in:
parent
19eb61f30c
commit
e7967cc0e1
3 changed files with 3 additions and 2 deletions
|
@ -288,7 +288,7 @@ public final class Offer implements StoragePayload, RequiresOwnerIsOnlinePayload
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PublicKey getOwnerPubKey() {
|
public PublicKey getOwnerPubKey() {
|
||||||
return pubKeyRing.getSignaturePubKey();
|
return pubKeyRing != null ? pubKeyRing.getSignaturePubKey() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getProtocolVersion() {
|
public long getProtocolVersion() {
|
||||||
|
|
|
@ -540,6 +540,7 @@ public class Connection implements MessageListener {
|
||||||
} else if (e instanceof EOFException || e instanceof StreamCorruptedException) {
|
} else if (e instanceof EOFException || e instanceof StreamCorruptedException) {
|
||||||
closeConnectionReason = CloseConnectionReason.TERMINATED;
|
closeConnectionReason = CloseConnectionReason.TERMINATED;
|
||||||
} else {
|
} else {
|
||||||
|
// TODO sometimes we get StreamCorruptedException, OptionalDataException, IllegalStateException
|
||||||
closeConnectionReason = CloseConnectionReason.UNKNOWN_EXCEPTION;
|
closeConnectionReason = CloseConnectionReason.UNKNOWN_EXCEPTION;
|
||||||
log.warn("Unknown reason for exception at socket {}\n\tconnection={}\n\tException=",
|
log.warn("Unknown reason for exception at socket {}\n\tconnection={}\n\tException=",
|
||||||
socket.toString(), this, e.toString());
|
socket.toString(), this, e.toString());
|
||||||
|
|
|
@ -443,7 +443,7 @@ public class P2PDataStorage implements MessageListener, ConnectionListener {
|
||||||
result = expirableMailboxStoragePayload.receiverPubKeyForRemoveOperation.equals(protectedStorageEntry.ownerPubKey);
|
result = expirableMailboxStoragePayload.receiverPubKeyForRemoveOperation.equals(protectedStorageEntry.ownerPubKey);
|
||||||
} else {
|
} else {
|
||||||
result = protectedStorageEntry != null && protectedStorageEntry.getStoragePayload() != null &&
|
result = protectedStorageEntry != null && protectedStorageEntry.getStoragePayload() != null &&
|
||||||
protectedStorageEntry.getStoragePayload().getOwnerPubKey().equals(protectedStorageEntry.ownerPubKey);
|
protectedStorageEntry.ownerPubKey.equals(protectedStorageEntry.getStoragePayload().getOwnerPubKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue