From 6de03f2bf0bf328fccf29bd7dd0d2407b0e1ed9b Mon Sep 17 00:00:00 2001 From: wb9688 Date: Fri, 31 Jul 2020 09:25:32 +0200 Subject: [PATCH] Fix crash when playing stream in background with shuffle in notification --- .../java/org/schabi/newpipe/player/NotificationUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java b/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java index d88a26b2f..f1b8356a8 100644 --- a/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java +++ b/app/src/main/java/org/schabi/newpipe/player/NotificationUtil.java @@ -351,7 +351,7 @@ public final class NotificationUtil { } break; case "shuffle": - if (basePlayerImpl.playQueue.isShuffled()) { + if (basePlayerImpl.playQueue != null && basePlayerImpl.playQueue.isShuffled()) { builder.addAction(R.drawable.exo_controls_shuffle_on, "ShuffleOn", PendingIntent.getBroadcast(context, NOTIFICATION_ID_BACKGROUND, new Intent(BackgroundPlayer.ACTION_SHUFFLE), @@ -601,7 +601,7 @@ public final class NotificationUtil { } break; case "shuffle": - if (basePlayerImpl.playQueue.isShuffled()) { + if (basePlayerImpl.playQueue != null && basePlayerImpl.playQueue.isShuffled()) { notificationBuilder.mActions.set(slotNumber, new NotificationCompat.Action(R.drawable.exo_controls_shuffle_on, "ShuffleOn", PendingIntent.getBroadcast(context, @@ -835,7 +835,7 @@ public final class NotificationUtil { } break; case "shuffle": - if (playerImpl.playQueue.isShuffled()) { + if (playerImpl.playQueue != null && playerImpl.playQueue.isShuffled()) { builder.addAction(R.drawable.exo_controls_shuffle_on, "ShuffleOn", PendingIntent.getBroadcast(context, NOTIFICATION_ID_POPUP, new Intent(PopupVideoPlayer.ACTION_SHUFFLE), @@ -1080,7 +1080,7 @@ public final class NotificationUtil { } break; case "shuffle": - if (playerImpl.playQueue.isShuffled()) { + if (playerImpl.playQueue != null && playerImpl.playQueue.isShuffled()) { notificationBuilder.mActions.set(slotNumber, new NotificationCompat.Action(R.drawable.exo_controls_shuffle_on, "ShuffleOn", PendingIntent.getBroadcast(context,