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 f0e65c7..02affd8 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);