From df34a4a4816d6e4caf22942f7f520879c143b0ed Mon Sep 17 00:00:00 2001 From: Jay Aliomer Date: Wed, 20 Oct 2021 11:17:01 -0400 Subject: [PATCH] Null check if renderer is null Local colors are added before the renderer is created which is causing crash Fixes: 203613925 Test: switch to user back and forward Change-Id: I2f169434e1cb0e692045050e255d24d1f8fa7c47 --- .../SystemUI/src/com/android/systemui/ImageWallpaper.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index d2566b448ba67..d1739aaccac28 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -238,9 +238,7 @@ public class ImageWallpaper extends WallpaperService { Bitmap bitmap = mMiniBitmap; if (bitmap == null) { mLocalColorsToAdd.addAll(regions); - mRenderer.use(b -> { - updateMiniBitmapAndNotify(b); - }); + if (mRenderer != null) mRenderer.use(this::updateMiniBitmapAndNotify); } else { computeAndNotifyLocalColors(regions, bitmap); }