From bdb39816ef9d0581395547a2f6a7476d825938b3 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 27 Nov 2019 00:03:50 +0200 Subject: [PATCH] NT fragment: copy the account objects when constructing the transaction to send the single account row without an amount has its amount set and this should not reflect the data in the model which may be re-displayed if when the save is unsuccessful --- .../ktnx/mobileledger/ui/activity/NewTransactionFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java index e9d2e331..10f246d7 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionFragment.java @@ -205,7 +205,8 @@ public class NewTransactionFragment extends Fragment { LedgerTransactionAccount emptyAmountAccount = null; float emptyAmountAccountBalance = 0; for (int i = 0; i < viewModel.getAccountCount(); i++) { - LedgerTransactionAccount acc = viewModel.getAccount(i); + LedgerTransactionAccount acc = + new LedgerTransactionAccount(viewModel.getAccount(i)); if (acc.getAccountName() .trim() .isEmpty()) -- 2.39.5