From b883f313bae6aa81491661654dc43814554938e8 Mon Sep 17 00:00:00 2001 From: John Zhen Mo Date: Sat, 4 Nov 2017 10:12:38 -0700 Subject: [PATCH] -Fixed NPE when popup is updated during shutdown. --- .../main/java/org/schabi/newpipe/player/PopupVideoPlayer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 48a435d37..a3fd0f7a7 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -362,6 +362,7 @@ public final class PopupVideoPlayer extends Service { } private void updatePopupSize(int width, int height) { + if (playerImpl == null) return; if (DEBUG) Log.d(TAG, "updatePopupSize() called with: width = [" + width + "], height = [" + height + "]"); width = (int) (width > maximumWidth ? maximumWidth : width < minimumWidth ? minimumWidth : width);