diff --git a/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt b/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt index b3e2932848..1285b65198 100644 --- a/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt +++ b/src/org/thoughtcrime/securesms/loki/fragments/ContactSelectionListFragment.kt @@ -12,6 +12,7 @@ import android.view.ViewGroup import kotlinx.android.synthetic.main.contact_selection_list_fragment.* import network.loki.messenger.R import org.thoughtcrime.securesms.contacts.ContactsCursorLoader +import org.thoughtcrime.securesms.logging.Log import org.thoughtcrime.securesms.mms.GlideApp import org.thoughtcrime.securesms.recipients.Recipient @@ -55,6 +56,11 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks) { - if (activity?.isDestroyed == true) { return } + private fun update(items: List) { + if (activity?.isDestroyed == true) { + Log.e(ContactSelectionListFragment::class.java.name, + "Received a loader callback after the fragment was detached from an activity.", + IllegalStateException()) + return + } listAdapter.items = items mainContentContainer.visibility = if (items.isEmpty()) View.GONE else View.VISIBLE emptyStateContainer.visibility = if (items.isEmpty()) View.VISIBLE else View.GONE @@ -110,4 +121,4 @@ class ContactSelectionListFragment : Fragment(), LoaderManager.LoaderCallbacks