From 21258f244c7a7cfbe79046df740972c60d9753be Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Sat, 8 Oct 2016 14:04:33 -0700 Subject: [PATCH] Don't crash on recipient preference change for non-signal user Fixes #5760 // FREEBIe --- .../securesms/RecipientPreferenceActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java index 43b9820d76..26982d00ea 100644 --- a/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java +++ b/src/org/thoughtcrime/securesms/RecipientPreferenceActivity.java @@ -295,16 +295,16 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi @Override public void onSuccess(Optional result) { if (result.isPresent()) { - identityPreference.setOnPreferenceClickListener(new IdentityClickedListener(result.get())); - identityPreference.setEnabled(true); + if (identityPreference != null) identityPreference.setOnPreferenceClickListener(new IdentityClickedListener(result.get())); + if (identityPreference != null) identityPreference.setEnabled(true); } else { - getPreferenceScreen().removePreference(identityPreference); + if (identityPreference != null) getPreferenceScreen().removePreference(identityPreference); } } @Override public void onFailure(ExecutionException e) { - getPreferenceScreen().removePreference(identityPreference); + if (identityPreference != null) getPreferenceScreen().removePreference(identityPreference); } }); }