[bisq-network/bisq] BSQ swaps: Low risk refactorings [2] (PR #5770)
Stan
notifications at github.com
Fri Oct 22 19:06:19 CEST 2021
@ghubstan commented on this pull request.
> @@ -414,7 +414,7 @@ public void validateBasicOfferData(PaymentMethod paymentMethod, String currencyC
// Immutable fields are sourced from the original openOffer param.
public OfferPayload getMergedOfferPayload(OpenOffer openOffer,
MutableOfferPayloadFields mutableOfferPayloadFields) {
- OfferPayload original = openOffer.getOffer().getOfferPayload();
+ OfferPayload original = openOffer.getOffer().getOfferPayload().orElseThrow();
How about throwing something more specific than a 'no such element' ex?
```
OfferPayload original = openOffer.getOffer().getOfferPayload().orElseThrow(() ->
new IllegalStateException(format("OpenOffer %s has no payload.", openOffer.getId())));
```
--
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/5770#pullrequestreview-787087368
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20211022/cab90c3b/attachment.htm>
More information about the bisq-github
mailing list