]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemHolder.java
whitespace
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / NewTransactionItemHolder.java
index c455a01434cdc186d281dfc6df29d4acf2cc07be..68ae8ef94cbabc16e151a13c0f003446b6563378 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()
@@ -309,15 +313,11 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder
                         catch (NumberFormatException e) {
                             Logger.debug("new-trans", String.format(
                                     "assuming amount is not set due to number format exception. " +
-                                    "input was '%s'",
-                                    amount));
+                                    "input was '%s'", amount));
                             item.getAccount()
                                 .resetAmount();
                         }
                     }
-                    else
-                        item.getAccount()
-                            .resetAmount();
 
                     break;
                 case bottomFiller: