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

Commit f13ce794 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Prevent NPE in QuickQSPanel

When QuickQSPanel is recreated with the media player flag on, mHost is
null before it is set and will cause an NPE. The tiles will be set
correctly after the first time mHost is set.

Fixes: 146155011
Test: switch to Dark mode and see it doesn't crash.
Change-Id: Iacd23db46ec3b4ea026efc75da32f10f1edb1567
parent b3321f66
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -177,7 +177,7 @@ public class QuickQSPanel extends QSPanel {
                record.tile.removeCallback(record.callback);
                record.tile.removeCallback(record.callback);
            }
            }
            mTileLayout = mMediaTileLayout;
            mTileLayout = mMediaTileLayout;
            setTiles(mHost.getTiles());
            if (mHost != null) setTiles(mHost.getTiles());
            mTileLayout.setListening(mListening);
            mTileLayout.setListening(mListening);
            return true;
            return true;
        } else if (!mMediaPlayer.hasMediaSession()
        } else if (!mMediaPlayer.hasMediaSession()
@@ -190,7 +190,7 @@ public class QuickQSPanel extends QSPanel {
                record.tile.removeCallback(record.callback);
                record.tile.removeCallback(record.callback);
            }
            }
            mTileLayout = mRegularTileLayout;
            mTileLayout = mRegularTileLayout;
            setTiles(mHost.getTiles());
            if (mHost != null) setTiles(mHost.getTiles());
            mTileLayout.setListening(mListening);
            mTileLayout.setListening(mListening);
            return true;
            return true;
        }
        }