Fix apps and shortcuts incorrectly deserialized if their profile has been removed

This commit is contained in:
MM20
2022-10-22 13:31:06 +02:00
parent 10d400a0c8
commit f5052f9bf7
2 changed files with 2 additions and 2 deletions
@@ -55,7 +55,7 @@ class LauncherShortcutDeserializer(
)
query.setShortcutIds(mutableListOf(id))
val userManager = context.getSystemService<UserManager>()!!
val user = userManager.getUserForSerialNumber(userSerial) ?: Process.myUserHandle()
val user = userManager.getUserForSerialNumber(userSerial) ?: return null
val shortcuts = try {
launcherApps.getShortcuts(query, user)
} catch (e: IllegalStateException) {