]> git.ktnx.net Git - mobile-ledger.git/commitdiff
avoid NPE in the inlikely event of no current profile
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 3 Mar 2019 14:25:45 +0000 (16:25 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 3 Mar 2019 14:25:45 +0000 (16:25 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/profiles/ProfilesRecyclerViewAdapter.java

index 9f2c48a246e253edc70a527435c3963c2e47b9b0..b056205126789d7f93eb3abc1c61af1aadfc96bb 100644 (file)
@@ -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()) {