File tree 1 file changed +7
-0
lines changed
app/src/main/java/org/schabi/newpipe/player/mediasession
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ public class MediaSessionPlayerUi extends PlayerUi
38
38
implements SharedPreferences .OnSharedPreferenceChangeListener {
39
39
private static final String TAG = "MediaSessUi" ;
40
40
41
+ @ Nullable
41
42
private MediaSessionCompat mediaSession ;
43
+ @ Nullable
42
44
private MediaSessionConnector sessionConnector ;
43
45
44
46
private final String ignoreHardwareMediaButtonsKey ;
@@ -198,6 +200,11 @@ private void updateMediaSessionActions() {
198
200
return ;
199
201
}
200
202
203
+ if (sessionConnector == null ) {
204
+ // sessionConnector will be null after destroyPlayer is called
205
+ return ;
206
+ }
207
+
201
208
// only use the fourth and fifth actions (the settings page also shows only the last 2 on
202
209
// Android 13+)
203
210
final List <NotificationActionData > newNotificationActions = IntStream .of (3 , 4 )
You can’t perform that action at this time.
0 commit comments