Fix a crash with media

This commit is contained in:
Thomas 2023-12-29 10:29:22 +01:00
parent fcc323af2a
commit 36e258adb3

View file

@ -110,9 +110,13 @@ public class FragmentMedia extends Fragment {
enableSliding(true);
}
});
binding.mediaPicture.setOnClickListener(v -> ((MediaActivity) requireActivity()).toogleFullScreen());
binding.mediaPicture.setOnClickListener(v -> {
if(isAdded()){((MediaActivity) requireActivity()).toogleFullScreen();}
});
binding.mediaVideo.setOnClickListener(v -> ((MediaActivity) requireActivity()).toogleFullScreen());
binding.mediaVideo.setOnClickListener(v -> {
if(isAdded()) {((MediaActivity) requireActivity()).toogleFullScreen();}
});
String type = attachment.type;
String preview_url = attachment.preview_url;