Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE in Portfolio View when market price n/a #5385

Merged
merged 1 commit into from Apr 1, 2021
Merged

Fix NPE in Portfolio View when market price n/a #5385

merged 1 commit into from Apr 1, 2021

Conversation

ghost
Copy link

@ghost ghost commented Mar 31, 2021

Query of market price may return null when the price is not available (e.g. priceserver temporarily down).
Portfolio View TriggerPriceService was not checking the market price object prior to use.

Fixes #5381

Screenshot from 2021-03-31 14-57-20

Copy link
Contributor

@wallclockbuilder wallclockbuilder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an offer, then set marketPrice=null;
Tried viewing the offer.
Got this error in the UI and the following error log.
null pointer exception
[JavaFX Application Thread] ERROR b.c.s.CommonSetup: Stack trace: java.lang.NullPointerException at bisq.core.offer.TriggerPriceService.wasTriggered(TriggerPriceService.java:125) at bisq.core.offer.TriggerPriceService.checkPriceThreshold(TriggerPriceService.java:140) at bisq.core.offer.TriggerPriceService.lambda$onPriceFeedChanged$4(TriggerPriceService.java:108) at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1608)

I'm able to view the offer just fine when the null value is guarded.

Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ripcurlx ripcurlx merged commit dca0d5b into bisq-network:master Apr 1, 2021
@ripcurlx ripcurlx added this to the v1.6.2 milestone Apr 1, 2021
@ghost ghost mentioned this pull request Apr 2, 2021
@ghost ghost deleted the fix_npe_portfolio_view branch May 29, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempt to open portfolio failed
2 participants