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
3c5da3007a
commit
b1a8cec3f8
3 changed files with 9 additions and 6 deletions
|
@ -194,8 +194,10 @@ public class PriceFeed {
|
||||||
Futures.addCallback(future, new FutureCallback<MarketPrice>() {
|
Futures.addCallback(future, new FutureCallback<MarketPrice>() {
|
||||||
public void onSuccess(MarketPrice marketPrice) {
|
public void onSuccess(MarketPrice marketPrice) {
|
||||||
UserThread.execute(() -> {
|
UserThread.execute(() -> {
|
||||||
|
if (marketPrice != null && priceConsumer != null) {
|
||||||
cache.put(marketPrice.currencyCode, marketPrice);
|
cache.put(marketPrice.currencyCode, marketPrice);
|
||||||
priceConsumer.accept(marketPrice.getPrice(type));
|
priceConsumer.accept(marketPrice.getPrice(type));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -793,6 +793,7 @@ public class Connection implements MessageListener {
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
stop();
|
stop();
|
||||||
|
if (sharedModel != null)
|
||||||
sharedModel.handleConnectionException(new Exception(t));
|
sharedModel.handleConnectionException(new Exception(t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,8 @@ public final class MailboxStoragePayload implements StoragePayload {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "MailboxStoragePayload{" +
|
return "MailboxStoragePayload{" +
|
||||||
"prefixedSealedAndSignedMessage=" + prefixedSealedAndSignedMessage +
|
"prefixedSealedAndSignedMessage=" + prefixedSealedAndSignedMessage +
|
||||||
", senderStoragePublicKey.hashCode()=" + senderPubKeyForAddOperation.hashCode() +
|
", senderPubKeyForAddOperation.hashCode()=" + (senderPubKeyForAddOperation != null ? senderPubKeyForAddOperation.hashCode() : "null") +
|
||||||
", receiverStoragePublicKey.hashCode()=" + receiverPubKeyForRemoveOperation.hashCode() +
|
", receiverPubKeyForRemoveOperation.hashCode()=" + (receiverPubKeyForRemoveOperation != null ? receiverPubKeyForRemoveOperation.hashCode() : "null") +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue