Fix crash if adaptive icon foreground or background is null

This commit is contained in:
MM20
2022-06-19 19:39:35 +02:00
parent 3cf0038c70
commit a303703d9e
5 changed files with 63 additions and 46 deletions
@@ -75,14 +75,18 @@ class AppShortcut(
} ?: return null
if (icon is AdaptiveIconDrawable) {
return StaticLauncherIcon(
foregroundLayer = StaticIconLayer(
icon = icon.foreground,
scale = 1.5f,
),
backgroundLayer = StaticIconLayer(
icon = icon.background,
scale = 1.5f,
)
foregroundLayer = icon.foreground?.let {
StaticIconLayer(
icon = it,
scale = 1.5f,
)
} ?: TransparentLayer,
backgroundLayer = icon.background?.let {
StaticIconLayer(
icon = it,
scale = 1.5f,
)
} ?: TransparentLayer,
)
}
return StaticLauncherIcon(