Fix crash from previewing launcher with unknown wallpaper colors.

Test: Open wallpaper app with live wallpaper applied should not crash.
Fix: 195246865
Change-Id: Id64de32b35aa7a553daa752438060d7f6822bec8
This commit is contained in:
Brian Isganitis 2021-08-04 14:21:27 -04:00
parent 25399db1e7
commit dafa5040ef
1 changed files with 2 additions and 2 deletions

View File

@ -268,8 +268,8 @@ public class LauncherPreviewRenderer extends ContextWrapper
WallpaperColors wallpaperColors = wallpaperColorsOverride != null
? wallpaperColorsOverride
: WallpaperManager.getInstance(context).getWallpaperColors(FLAG_SYSTEM);
mWallpaperColorResources = LocalColorExtractor.newInstance(context)
.generateColorsOverride(wallpaperColors);
mWallpaperColorResources = wallpaperColors != null ? LocalColorExtractor.newInstance(
context).generateColorsOverride(wallpaperColors) : null;
} else {
mWallpaperColorResources = null;
}