]> git.ktnx.net Git - mobile-ledger.git/commitdiff
avoid crash when removing the currency of a row
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 4 Mar 2021 21:23:34 +0000 (23:23 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 4 Mar 2021 21:23:34 +0000 (23:23 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/new_transaction/NewTransactionItemHolder.java

index 01c3bfdf7d07667025666542ba746a17cc5afa5f..f60980fa652e1b770909ac3d36b89c46f5a0cea4 100644 (file)
@@ -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");
         });