From 8d1035d3cde03cf21b1ce6001eaaca844c37e93e Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 3 Mar 2019 16:25:45 +0200 Subject: [PATCH] avoid NPE in the inlikely event of no current profile --- .../mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()) { -- 2.39.5