From: Damyan Ivanov Date: Wed, 6 Apr 2022 19:24:58 +0000 (+0300) Subject: explicit assert of non-null value X-Git-Tag: v0.21.3~1 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=dd7e3b83b17546504605f93b3a462d1a1be3b382;p=mobile-ledger.git explicit assert of non-null value --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java index 2ae7b5e1..d8f387b7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java @@ -487,7 +487,8 @@ public class NewTransactionModel extends ViewModel { "Should not happen: approved transaction has %d accounts for " + "currency %s", accounts.size(), currency)); accounts.get(0) - .setAmount(-emptyAmountAccountBalance.get(currency)); + .setAmount(-Objects.requireNonNull( + emptyAmountAccountBalance.get(currency))); }); } else { @@ -500,7 +501,8 @@ public class NewTransactionModel extends ViewModel { "Should not happen: approved transaction has %d accounts for " + "currency %s", accounts.size(), currency)); accounts.get(0) - .setAmount(-emptyAmountAccountBalance.get(currency)); + .setAmount(-Objects.requireNonNull( + emptyAmountAccountBalance.get(currency))); } } }