From 425d6b8adfd49a625edb69774857ad71267fda8c Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Wed, 20 Dec 2017 11:10:12 -0800 Subject: [PATCH] Fix crash for dynamic permissions + background directory load --- .../thoughtcrime/securesms/ContactSelectionListFragment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/ContactSelectionListFragment.java b/src/org/thoughtcrime/securesms/ContactSelectionListFragment.java index 132b18d431..0f4f59968c 100644 --- a/src/org/thoughtcrime/securesms/ContactSelectionListFragment.java +++ b/src/org/thoughtcrime/securesms/ContactSelectionListFragment.java @@ -213,7 +213,10 @@ public class ContactSelectionListFragment extends Fragment public void reset() { selectedContacts.clear(); - getLoaderManager().restartLoader(0, null, this); + + if (!isDetached() && !isRemoving() && getActivity() != null && !getActivity().isFinishing()) { + getLoaderManager().restartLoader(0, null, this); + } } @Override