[bisq-network/bisq] Fix ClassCastException in Portfolio History screen (#5358)

jmacxx notifications at github.com
Fri Mar 26 00:05:50 CET 2021


Exception in Portfolio History view because `wasMyOffer(tradable)` is being used to check if the list item is an offer or trade.


---

To reproduce the problem: your portfolio history contains a canceled offer that was made with a different onion address.  This can be quite common if you have changed your onion address (see https://github.com/bisq-network/bisq/issues/5035 and https://github.com/bisq-network/bisq/issues/3995)


![exception](https://user-images.githubusercontent.com/47253594/112553263-2aef4e80-8d92-11eb-8762-40f6c011e5e4.png)


    Mar-25 17:29:39.270 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Uncaught Exception from thread JavaFX Application Thread 
    Mar-25 17:29:39.270 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableMessage= bisq.core.offer.OpenOffer cannot be cast to bisq.core.trade.Trade 
    Mar-25 17:29:39.270 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableClass= class java.lang.ClassCastException 
    Mar-25 17:29:39.272 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Stack trace:
    java.lang.ClassCastException: bisq.core.offer.OpenOffer cannot be cast to bisq.core.trade.Trade
	    at bisq.desktop.main.portfolio.closedtrades.ClosedTradesViewModel.getTradeFee(ClosedTradesViewModel.java:177)
	    at bisq.desktop.main.portfolio.closedtrades.ClosedTradesView$12$1.updateItem(ClosedTradesView.java:678)
	    at bisq.desktop.main.portfolio.closedtrades.ClosedTradesView$12$1.updateItem(ClosedTradesView.java:674)
	    at javafx.scene.control.TableCell.updateItem(TableCell.java:665)
	


You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/5358

-- Commit Summary --

  * Fix ClassCastException in Portfolio History screen

-- File Changes --

    M desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesViewModel.java (2)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/5358.patch
https://github.com/bisq-network/bisq/pull/5358.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/5358
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210325/d7e165a7/attachment.htm>


More information about the bisq-github mailing list