Fix crash if adaptive icon foreground or background is null
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user