From 4ddd778d0e0416c4e41d33e85c7a8cce1e8e1794 Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Fri, 19 Jun 2020 11:37:08 -0700 Subject: [PATCH] Fix the exception when shortcut info was removed before loading persisted bubbles Bug: 159243080 Test: manual Change-Id: Ie3211ae97de1ed146a639424ffbc7f19bd496c8e --- .../src/com/android/systemui/bubbles/BubbleDataRepository.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDataRepository.kt b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDataRepository.kt index 0c25d144938c2..390f7064a2271 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDataRepository.kt +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleDataRepository.kt @@ -162,7 +162,7 @@ internal class BubbleDataRepository @Inject constructor( // into Bubble. val bubbles = entities.mapNotNull { entity -> shortcutMap[ShortcutKey(entity.userId, entity.packageName)] - ?.first { shortcutInfo -> entity.shortcutId == shortcutInfo.id } + ?.firstOrNull { shortcutInfo -> entity.shortcutId == shortcutInfo.id } ?.let { shortcutInfo -> Bubble( entity.key, shortcutInfo,