]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fix off by one error when filling transaction after selecting description
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 11 Nov 2019 06:39:42 +0000 (08:39 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 11 Nov 2019 06:39:42 +0000 (08:39 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionItemsAdapter.java

index 76894bc33524d6257261ea7f78bf4f7bb371379e..21752a4467c56a829c60dccb69fd0fb61bff2370 100644 (file)
@@ -144,7 +144,7 @@ class NewTransactionItemsAdapter extends RecyclerView.Adapter<NewTransactionItem
             for (int i = 0; i < accounts.size(); i++) {
                 LedgerTransactionAccount acc = accounts.get(i);
                 NewTransactionModel.Item item;
-                if (model.getAccountCount() < i) {
+                if (model.getAccountCount() < i + 1) {
                     model.addAccount(acc);
                     notifyItemInserted(i + 1);
                 }