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

Commit 2c374ccc authored by Tom Marshall's avatar Tom Marshall Committed by Gerrit Code Review
Browse files

Merge "fw: media: Handle NPE due to threading race" into cm-11.0

parents cf481de2 aeb21530
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2192,6 +2192,7 @@ public class MediaPlayer implements SubtitleController.Listener
                Log.w(TAG, "mediaplayer went away with unhandled events");
                return;
            }
            try {
            switch(msg.what) {
            case MEDIA_PREPARED:
                scanInternalSubtitleTracks();
@@ -2307,6 +2308,13 @@ public class MediaPlayer implements SubtitleController.Listener
                Log.e(TAG, "Unknown message type " + msg.what);
                return;
            }
            } catch (NullPointerException e) {
                /**
                 * We may get an NPE even with the null checks above due
                 * to threading issues.  Just ignore it.
                 */
                Log.e(TAG, "Unhandled NPE from message type " + msg.what);
            }
        }
    }