Commit 176d77d7 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Fix native crash when dismissing a dialog too early

Fixes #1567
parent 88edbaab
Pipeline #46423 passed with stage
in 2 minutes and 24 seconds
......@@ -83,9 +83,9 @@ class SubtitleDownloaderDialogFragment : VLCBottomSheetDialogFragment() {
uris = savedInstanceState?.getParcelableArrayList<Uri>(MEDIA_PATHS)?.toList()
?: arguments?.getParcelableArrayList<Uri>(MEDIA_PATHS)?.toList() ?: listOf()
if (uris.isEmpty()) dismiss()
viewModel = ViewModelProvider(requireActivity(), SubtitlesModel.Factory(requireContext(), uris[0])).get(uris[0].path!!, SubtitlesModel::class.java)
if (uris.isEmpty()) dismiss()
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
......
......@@ -132,8 +132,8 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
popup.menuInflater.inflate(R.menu.audio_track_menu, popup.menu)
popup.show()
popup.setOnMenuItemClickListener {
dismiss()
menuItemListener.invoke(it.itemId)
dismiss()
true
}
}
......@@ -143,8 +143,8 @@ class VideoTracksDialog : VLCBottomSheetDialogFragment() {
popup.menuInflater.inflate(R.menu.subtitle_track_menu, popup.menu)
popup.show()
popup.setOnMenuItemClickListener {
dismiss()
menuItemListener.invoke(it.itemId)
dismiss()
true
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment