diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-02-02 21:33:31 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-02-02 21:33:31 +0100 |
commit | 17ab39fe45fce74fd5ef6cbc668ab88b233bb0e5 (patch) | |
tree | 47c6d72c4846e33e7c14c9904cdc886208a8a50c /src | |
parent | 64826a6fd9a8f013fe78fb12e6fc366adce7e122 (diff) |
don't crash if player == null
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java b/src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java index d1faaaf3b..8de0deb8a 100644 --- a/src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java +++ b/src/main/java/de/pixart/messenger/ui/MediaViewerActivity.java @@ -348,21 +348,21 @@ public class MediaViewerActivity extends XmppActivity implements AudioManager.On } private void pausePlayer() { - if (isVideo && isPlaying()) { + if (player != null && isVideo && isPlaying()) { player.setPlayWhenReady(false); player.getPlaybackState(); } } private void startPlayer() { - if (isVideo && !isPlaying()) { + if (player != null && isVideo && !isPlaying()) { player.setPlayWhenReady(true); player.getPlaybackState(); } } private void stopPlayer() { - if (isVideo) { + if (player != null && isVideo) { if (isPlaying()) { player.stop(true); } |