From a6fdfa98f01366db77c1d2774575aee0b3b1b410 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Wed, 9 Jan 2019 20:18:15 +0000 Subject: [PATCH] two NPE fixed --- .../ui/transaction_list/TransactionListViewModel.java | 6 +++--- app/src/main/res/menu/transaction_list.xml | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) 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 299fcbb8..d391b622 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 @@ -35,9 +35,9 @@ public class TransactionListViewModel extends ViewModel { public static ObservableValue updating = new ObservableValue<>(); public static void scheduleTransactionListReload(Activity act) { - boolean hasFilter = - act.findViewById(R.id.transaction_list_account_name_filter).getVisibility() == - View.VISIBLE; + View filter = act.findViewById(R.id.transaction_list_account_name_filter); + if (filter == null) return; + boolean hasFilter = filter.getVisibility() == View.VISIBLE; String accFilter = hasFilter ? String.valueOf( ((AutoCompleteTextView) act.findViewById(R.id.transaction_filter_account_name)) .getText()) : null; diff --git a/app/src/main/res/menu/transaction_list.xml b/app/src/main/res/menu/transaction_list.xml index 80232e4a..b74b09a2 100644 --- a/app/src/main/res/menu/transaction_list.xml +++ b/app/src/main/res/menu/transaction_list.xml @@ -1,6 +1,6 @@