From dd7e3b83b17546504605f93b3a462d1a1be3b382 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 6 Apr 2022 22:24:58 +0300 Subject: [PATCH] explicit assert of non-null value --- .../ui/new_transaction/NewTransactionModel.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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))); } } } -- 2.39.5