DivestOS/Patches/Common/android_packages_apps_Messaging/0001-null-fix.patch
Tad 7d2c184d1f
Bonus patches
Signed-off-by: Tad <tad@spotco.us>
2023-10-03 15:17:06 -04:00

32 lines
1.6 KiB
Diff

From fc22d2d5b977de8a148677ad5a15b20f97f1bd49 Mon Sep 17 00:00:00 2001
From: Pratyush <codelab@pratyush.dev>
Date: Fri, 22 Sep 2023 12:22:01 +0530
Subject: [PATCH] [bugfixes] handle null case
android docs doesn't state if SubscriptionInfo.getDisplayName() can return null, according to crash log it is returning null.
---
src/com/android/messaging/datamodel/ParticipantRefresh.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/com/android/messaging/datamodel/ParticipantRefresh.java b/src/com/android/messaging/datamodel/ParticipantRefresh.java
index 55d439bd..1726d69e 100644
--- a/src/com/android/messaging/datamodel/ParticipantRefresh.java
+++ b/src/com/android/messaging/datamodel/ParticipantRefresh.java
@@ -46,6 +46,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -391,7 +392,7 @@ private static void refreshSelfParticipantList() {
for (final Integer subId : activeSubscriptionIdToRecordMap.keySet()) {
final SubscriptionInfo record = activeSubscriptionIdToRecordMap.get(subId);
final String displayName =
- DatabaseUtils.sqlEscapeString(record.getDisplayName().toString());
+ DatabaseUtils.sqlEscapeString(Objects.toString(record.getDisplayName(), ""));
db.execSQL(getUpdateSelfParticipantSubscriptionInfoSql(record.getSimSlotIndex(),
record.getIconTint(), displayName,
ParticipantColumns.SUB_ID + " = " + subId));