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

Commit faabf3d4 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Prevent NPE from null metadata in GPM

Bug: 77238060
Test: Compile
Change-Id: I360e1da83dcb147013cca7ccf6d14ee0f162ec54
parent eac17ef8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -30,6 +30,10 @@ class GPMWrapper extends MediaPlayerWrapper {

    @Override
    boolean isMetadataSynced() {
        if (getQueue() == null) {
            return false;
        }

        // Check if currentPlayingQueueId is in the queue
        MediaSession.QueueItem currItem = null;
        for (MediaSession.QueueItem item : getQueue()) {
@@ -47,7 +51,7 @@ class GPMWrapper extends MediaPlayerWrapper {
            if (DEBUG) {
                Log.d(TAG, "Metadata currently out of sync for Google Play Music");
                Log.d(TAG, "  └ Current queueItem: " + currItem);
                Log.d(TAG, "  └ Current metadata : " + getMetadata().getDescription());
                Log.d(TAG, "  └ Current metadata : " + getMetadata());
            }
            return false;
        }