Fix possible crash where tooltip is dismissed after fragment is detached.

This commit is contained in:
Alex Hart 2022-10-17 12:28:48 -03:00 committed by Greyson Parrelli
parent 1006af7d8a
commit ba3dd79d4e

View file

@ -60,7 +60,10 @@ class StoryTextLoader(
contentView.layout(0, 0, contentView.measuredWidth, contentView.measuredHeight)
fragment.displayInDialogAboveAnchor(view, contentView, windowDim = 0f, onDismiss = {
callback.setIsDisplayingLinkPreviewTooltip(false)
val activity = fragment.activity
if (activity != null) {
callback.setIsDisplayingLinkPreviewTooltip(false)
}
})
}
}