Skip to content

Commit 0cf4732

Browse files
committed
Fix UI crash when user navigates away before the download dialog appears
1 parent 53edd05 commit 0cf4732

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/src/main/java/org/schabi/newpipe/info_list/dialog/StreamDialogDefaultEntry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public enum StreamDialogDefaultEntry {
113113
DOWNLOAD(R.string.download, (fragment, item) ->
114114
fetchStreamInfoAndSaveToDatabase(fragment.requireContext(), item.getServiceId(),
115115
item.getUrl(), info -> {
116-
if (fragment.getContext() != null) {
116+
if (fragment.isAdded() && !fragment.isStateSaved()) {
117117
final DownloadDialog downloadDialog =
118118
new DownloadDialog(fragment.requireContext(), info);
119119
downloadDialog.show(fragment.getChildFragmentManager(),

0 commit comments

Comments
 (0)