From 72999c7d12ccb5c3705e567eddc9d3194331f638 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 24 Aug 2020 09:11:48 +1000 Subject: [PATCH] Hopefully fix crash --- .../loki/fragments/ContactSelectionListFragment.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt b/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt index 2bd6924783..b3e2932848 100644 --- a/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt +++ b/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt @@ -23,11 +23,11 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks> { - return ContactSelectionListLoader(activity!!, - activity!!.intent.getIntExtra(DISPLAY_MODE, ContactsCursorLoader.DisplayMode.FLAG_ALL), + return ContactSelectionListLoader(requireActivity(), + requireActivity().intent.getIntExtra(DISPLAY_MODE, ContactsCursorLoader.DisplayMode.FLAG_ALL), cursorFilter) } @@ -93,6 +93,7 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks) { + if (activity?.isDestroyed == true) { return } listAdapter.items = items mainContentContainer.visibility = if (items.isEmpty()) View.GONE else View.VISIBLE emptyStateContainer.visibility = if (items.isEmpty()) View.VISIBLE else View.GONE