Fix UI crash when user navigates away before the download dialog appears

This commit is contained in:
Elva Kang 2024-10-19 19:43:34 +11:00
parent 53edd054aa
commit 0cf4732d8a
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ public enum StreamDialogDefaultEntry {
DOWNLOAD(R.string.download, (fragment, item) ->
fetchStreamInfoAndSaveToDatabase(fragment.requireContext(), item.getServiceId(),
item.getUrl(), info -> {
if (fragment.getContext() != null) {
if (fragment.isAdded() && !fragment.isStateSaved()) {
final DownloadDialog downloadDialog =
new DownloadDialog(fragment.requireContext(), info);
downloadDialog.show(fragment.getChildFragmentManager(),