]> git.ktnx.net Git - mobile-ledger.git/commitdiff
transaction list: no crash of the transaction list is not loaded yet and an item...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 19 Jan 2019 18:26:27 +0000 (18:26 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 19 Jan 2019 18:26:27 +0000 (18:26 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java

index f0e65c7d32809f56b655451aff4d9ce5fc3074c8..02affd86735f85bf5710f59395e379043c0163fe 100644 (file)
@@ -38,6 +38,7 @@ public class TransactionListViewModel extends ViewModel {
     }
     public static TransactionListItem getTransactionListItem(int position) {
         List<TransactionListItem> transactions = Data.transactions.get();
+        if (transactions == null) return null;
         if (position >= transactions.size() + 1) return null;
         if (position == transactions.size()) return new TransactionListItem();
         return transactions.get(position);