PreviewMediaFragment: fix crash when changing theme with audio fragment

Exoplayer is null when recreating

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
This commit is contained in:
Álvaro Brey Vilas 2022-03-22 18:47:08 +01:00
parent 6a527a6e87
commit b8bb261234
No known key found for this signature in database
GPG key ID: 2585783189A62105

View file

@ -703,9 +703,11 @@ public class PreviewMediaFragment extends FileFragment implements OnTouchListene
@Override
public void onDetach() {
exoPlayer.stop();
exoPlayer.release();
if (exoPlayer != null) {
exoPlayer.stop();
exoPlayer.release();
}
super.onDetach();
}