Merge pull request #5753 from jmacxx/fix_exception_enteroffer

Fix exception in offer entry UI
This commit is contained in:
Christoph Atteneder 2021-10-14 20:39:11 +02:00 committed by GitHub
commit c9a6407582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1156,7 +1156,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
long maxTradeLimit = dataModel.getMaxTradeLimit();
Price price = dataModel.getPrice().get();
if (price != null) {
if (price != null && price.isPositive()) {
if (dataModel.isUsingHalCashAccount())
amount = CoinUtil.getAdjustedAmountForHalCash(amount, price, maxTradeLimit);
else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get()))
@ -1180,7 +1180,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
Price price = dataModel.getPrice().get();
long maxTradeLimit = dataModel.getMaxTradeLimit();
if (price != null) {
if (price != null && price.isPositive()) {
if (dataModel.isUsingHalCashAccount())
minAmount = CoinUtil.getAdjustedAmountForHalCash(minAmount, price, maxTradeLimit);
else if (CurrencyUtil.isFiatCurrency(tradeCurrencyCode.get()))