From: Damyan Ivanov Date: Sat, 19 Jan 2019 18:26:27 +0000 (+0000) Subject: transaction list: no crash of the transaction list is not loaded yet and an item... X-Git-Tag: v0.3~22 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=ecca90e33d5334dd3a6750cb92f626bcff10a439;p=mobile-ledger.git transaction list: no crash of the transaction list is not loaded yet and an item is requested --- 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);