Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5482d342 authored by Sungsoo Lim's avatar Sungsoo Lim
Browse files

Prevent NPE in MediaSessionService

Guard against null UserRecord when dispatching a media key event.

Bug: 22966229
Change-Id: I32f4f87e06d8af13b94bb8f28180a66517c23c33
parent 0477e978
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -948,8 +948,8 @@ public class MediaSessionService extends SystemService implements Monitor {
                // Launch the last PendingIntent we had with priority
                int userId = ActivityManager.getCurrentUser();
                UserRecord user = mUserRecords.get(userId);
                if (user.mLastMediaButtonReceiver != null
                        || user.mRestoredMediaButtonReceiver != null) {
                if (user != null && (user.mLastMediaButtonReceiver != null
                        || user.mRestoredMediaButtonReceiver != null)) {
                    if (DEBUG) {
                        Log.d(TAG, "Sending media key to last known PendingIntent "
                                + user.mLastMediaButtonReceiver + " or restored Intent "