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

Commit 128217d9 authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Add mDestroyed null check

A NPE can happen if a message DO_DETACH is sent to the engine before
DO_ATTACH.

Test: treehugger (this CL does nothing except avoiding a crash)
Bug: 294826232
Change-Id: Ib344a3495ea1f92eebbb4f170f92c03b6e839612
parent 11d6424a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2556,7 +2556,7 @@ public abstract class WallpaperService extends Service {
        private void doDetachEngine() {
            // Some wallpapers will not trigger the rendering threads of the remaining engines even
            // if they are visible, so we need to toggle the state to get their attention.
            if (!mEngine.mDestroyed) {
            if (mEngine != null && !mEngine.mDestroyed) {
                mEngine.detach();
                synchronized (mActiveEngines) {
                    for (IWallpaperEngineWrapper engineWrapper : mActiveEngines.values()) {