mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-21 18:42:35 +01:00
Fix UI crash when user navigates away before the download dialog appears
This commit is contained in:
parent
53edd054aa
commit
0cf4732d8a
@ -113,7 +113,7 @@ public enum StreamDialogDefaultEntry {
|
|||||||
DOWNLOAD(R.string.download, (fragment, item) ->
|
DOWNLOAD(R.string.download, (fragment, item) ->
|
||||||
fetchStreamInfoAndSaveToDatabase(fragment.requireContext(), item.getServiceId(),
|
fetchStreamInfoAndSaveToDatabase(fragment.requireContext(), item.getServiceId(),
|
||||||
item.getUrl(), info -> {
|
item.getUrl(), info -> {
|
||||||
if (fragment.getContext() != null) {
|
if (fragment.isAdded() && !fragment.isStateSaved()) {
|
||||||
final DownloadDialog downloadDialog =
|
final DownloadDialog downloadDialog =
|
||||||
new DownloadDialog(fragment.requireContext(), info);
|
new DownloadDialog(fragment.requireContext(), info);
|
||||||
downloadDialog.show(fragment.getChildFragmentManager(),
|
downloadDialog.show(fragment.getChildFragmentManager(),
|
||||||
|
Loading…
Reference in New Issue
Block a user