From: Damyan Ivanov Date: Sun, 3 Mar 2019 14:25:45 +0000 (+0200) Subject: avoid NPE in the inlikely event of no current profile X-Git-Tag: v0.7~16 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=8d1035d3cde03cf21b1ce6001eaaca844c37e93e;p=mobile-ledger.git avoid NPE in the inlikely event of no current profile --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java index 9f2c48a2..b0562051 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java @@ -177,7 +177,7 @@ public class ProfilesRecyclerViewAdapter holder.mEditButton.setOnClickListener(mOnClickListener); - final boolean sameProfile = currentProfile.equals(profile); + final boolean sameProfile = (currentProfile != null) && currentProfile.equals(profile); holder.itemView .setBackground(sameProfile ? new ColorDrawable(Colors.tableRowDarkBG) : null); if (editingProfiles.get()) {