]> git.ktnx.net Git - mobile-ledger.git/commitdiff
invert if(!smth) {} else {} condition
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 13 Nov 2019 21:40:29 +0000 (23:40 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 13 Nov 2019 21:40:29 +0000 (23:40 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java

index c455a01434cdc186d281dfc6df29d4acf2cc07be..82403a87af20640063f872e4f38e28d61e5ada0d 100644 (file)
@@ -300,7 +300,11 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                     String amount = String.valueOf(tvAmount.getText());
                     amount = amount.trim();
 
-                    if (!amount.isEmpty()) {
+                    if (amount.isEmpty()) {
+                        item.getAccount()
+                            .resetAmount();
+                    }
+                    else {
                         try {
                             amount = amount.replace(decimalSeparator, decimalDot);
                             item.getAccount()
@@ -315,9 +319,6 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                                 .resetAmount();
                         }
                     }
-                    else
-                        item.getAccount()
-                            .resetAmount();
 
                     break;
                 case bottomFiller: