Fix crash in onPlaying if fragment is detached.

This commit is contained in:
Alex Hart 2022-05-23 13:15:41 -03:00
parent f013f7357f
commit 32b4d11a82

View file

@ -63,7 +63,7 @@ public final class VideoMediaPreviewFragment extends MediaPreviewFragment {
@Override
public void onPlaying() {
if (!isVideoGif && requireActivity() instanceof VoiceNoteMediaControllerOwner) {
if (!isVideoGif && getActivity() instanceof VoiceNoteMediaControllerOwner) {
((VoiceNoteMediaControllerOwner) requireActivity()).getVoiceNoteMediaController().pausePlayback();
}
}