diff --git a/core/src/main/java/bisq/core/api/CoreTradesService.java b/core/src/main/java/bisq/core/api/CoreTradesService.java index 1b58334466b..dbc6927f452 100644 --- a/core/src/main/java/bisq/core/api/CoreTradesService.java +++ b/core/src/main/java/bisq/core/api/CoreTradesService.java @@ -21,6 +21,7 @@ import bisq.core.btc.wallet.BtcWalletService; import bisq.core.offer.Offer; import bisq.core.offer.takeoffer.TakeOfferModel; +import bisq.core.trade.Tradable; import bisq.core.trade.Trade; import bisq.core.trade.TradeManager; import bisq.core.trade.TradeUtil; @@ -199,7 +200,8 @@ private Optional getOpenTrade(String tradeId) { } private Optional getClosedTrade(String tradeId) { - return closedTradableManager.getTradableById(tradeId).map(value -> (Trade) value); + Optional tradable = closedTradableManager.getTradableById(tradeId); + return tradable.filter((t) -> t instanceof Trade).map(value -> (Trade) value); } private boolean isFollowingBuyerProtocol(Trade trade) {