From 78981bbb8f51345cdd087ae653de6f9d0fe6dea8 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Fri, 10 Nov 2023 15:17:22 -0600 Subject: [PATCH] Fix NPE due to null collection access in maybeClearStaleRates. --- src/main/java/bisq/price/spot/ExchangeRateProvider.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/bisq/price/spot/ExchangeRateProvider.java b/src/main/java/bisq/price/spot/ExchangeRateProvider.java index 56fe747..3006fb3 100644 --- a/src/main/java/bisq/price/spot/ExchangeRateProvider.java +++ b/src/main/java/bisq/price/spot/ExchangeRateProvider.java @@ -134,6 +134,9 @@ public String getPrefix() { } public void maybeClearStaleRates() { + if (get() == null) { + return; + } // a stale rate is older than the specified interval, except: // timestamp of 0L is used as special case re: CoinMarketCap and BitcoinAverage // (https://github.com/bisq-network/bisq-pricenode/issues/23)