]> git.ktnx.net Git - mobile-ledger.git/commitdiff
explicit assert of non-null value
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 6 Apr 2022 19:24:58 +0000 (22:24 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 6 Apr 2022 19:28:14 +0000 (19:28 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionModel.java

index 2ae7b5e1b4eebf8ebb48564255d66ab86a888f70..d8f387b72696983f1fe9f87d0ae12e0a5b4d1be8 100644 (file)
@@ -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)));
                 }
             }
         }