From: Damyan Ivanov Date: Wed, 9 Jan 2019 20:18:15 +0000 (+0000) Subject: two NPE fixed X-Git-Tag: v0.3~90 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=a6fdfa98f01366db77c1d2774575aee0b3b1b410;p=mobile-ledger.git two NPE fixed --- 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 @@