File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe/player/mediasession Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ public class MediaSessionPlayerUi extends PlayerUi
3838 implements SharedPreferences .OnSharedPreferenceChangeListener {
3939 private static final String TAG = "MediaSessUi" ;
4040
41+ @ Nullable
4142 private MediaSessionCompat mediaSession ;
43+ @ Nullable
4244 private MediaSessionConnector sessionConnector ;
4345
4446 private final String ignoreHardwareMediaButtonsKey ;
@@ -198,6 +200,11 @@ private void updateMediaSessionActions() {
198200 return ;
199201 }
200202
203+ if (sessionConnector == null ) {
204+ // sessionConnector will be null after destroyPlayer is called
205+ return ;
206+ }
207+
201208 // only use the fourth and fifth actions (the settings page also shows only the last 2 on
202209 // Android 13+)
203210 final List <NotificationActionData > newNotificationActions = IntStream .of (3 , 4 )
You can’t perform that action at this time.
0 commit comments