From 38f6efbcae5f3ce96d6be6e0d9cf26c7a72e6e69 Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Wed, 8 Sep 2021 08:22:36 -0300 Subject: [PATCH] Fix NPE in VideoPlayer error handler. --- .../java/org/thoughtcrime/securesms/video/VideoPlayer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/video/VideoPlayer.java b/app/src/main/java/org/thoughtcrime/securesms/video/VideoPlayer.java index 0f15be60f..f490f956f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/video/VideoPlayer.java +++ b/app/src/main/java/org/thoughtcrime/securesms/video/VideoPlayer.java @@ -117,8 +117,11 @@ public class VideoPlayer extends FrameLayout { } @Override - public void onPlayerError(PlaybackException error) { - playerCallback.onError(); + public void onPlayerError(@NonNull PlaybackException error) { + Log.w(TAG, "A player error occurred", error); + if (playerCallback != null) { + playerCallback.onError(); + } } }); exoView.setPlayer(exoPlayer);