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