From: Damyan Ivanov Date: Sun, 28 Feb 2021 16:55:00 +0000 (+0200) Subject: avoid crash when there is no information about focused element X-Git-Tag: v0.17.0~67 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=7c71fa95c5015c7cb3ba7d7c2ee3e41441e3d78a;p=mobile-ledger.git avoid crash when there is no information about focused element observed when sending the transaction to the backend throws an exception --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java index 470467d4..4274a99b 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java @@ -209,7 +209,7 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder } ignoreFocusChanges = true; try { - if (((focusInfo == null) || + if (((focusInfo == null) || (focusInfo.element == null) || focusInfo.position != getAdapterPosition()) || itemView.hasFocus()) return;