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

Commit aeb21530 authored by Tom Marshall's avatar Tom Marshall
Browse files

fw: media: Handle NPE due to threading race

Change-Id: I6eab5bc3d687edfa6f0839e439b3314bed4fdcea
parent f4b90e00
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);
            }
        }
    }