From ecca90e33d5334dd3a6750cb92f626bcff10a439 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sat, 19 Jan 2019 18:26:27 +0000 Subject: [PATCH] transaction list: no crash of the transaction list is not loaded yet and an item is requested --- .../ui/transaction_list/TransactionListViewModel.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java index f0e65c7d..02affd86 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListViewModel.java @@ -38,6 +38,7 @@ public class TransactionListViewModel extends ViewModel { } public static TransactionListItem getTransactionListItem(int position) { List 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); -- 2.39.5