From: Damyan Ivanov Date: Thu, 4 Mar 2021 21:23:34 +0000 (+0200) Subject: avoid crash when removing the currency of a row X-Git-Tag: v0.17.0~28 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=20c84d4501460fbe7eb3587b98e540a277b7d6db;p=mobile-ledger.git avoid crash when removing the currency of a row --- 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 01c3bfdf..f60980fa 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 @@ -207,8 +207,8 @@ class NewTransactionItemHolder extends RecyclerView.ViewHolder b.currencyButton.setOnClickListener(v -> { CurrencySelectorFragment cpf = new CurrencySelectorFragment(); cpf.showPositionAndPadding(); - cpf.setOnCurrencySelectedListener( - c -> adapter.setItemCurrency(getAdapterPosition(), c.getName())); + cpf.setOnCurrencySelectedListener(c -> adapter.setItemCurrency(getAdapterPosition(), + (c == null) ? null : c.getName())); cpf.show(activity.getSupportFragmentManager(), "currency-selector"); });