commit 95012b4232d8b8e75998d7ff03c4166c3ee112db
parent a5a7eed8d3afcb3e02d1b33b6d418adf06603f5a
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date:   Thu, 18 May 2023 16:11:11 +0200

fix(notifications): fix npe

Diffstat:
Mapp/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/Notifications.kt | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/Notifications.kt b/app/src/main/kotlin/me/rhunk/snapenhance/features/impl/extras/Notifications.kt @@ -162,14 +162,14 @@ class Notifications : Feature("Notifications", loadParams = FeatureLoadParams.IN val extras: Bundle = notificationData.notification.extras.getBundle("system_notification_extras")?: return@hook - val messageId = extras.getString("message_id")!! - val notificationType = extras.getString("notification_type")!! - val conversationId = extras.getString("conversation_id")!! + val messageId = extras.getString("message_id") ?: return@hook + val notificationType = extras.getString("notification_type") ?: return@hook + val conversationId = extras.getString("conversation_id") ?: return@hook if (!notificationType.endsWith("CHAT") && !notificationType.endsWith("SNAP")) return@hook val conversationManager: Any = context.feature(Messaging::class).conversationManager - notificationDataQueue[messageId.toLong()] = notificationData + notificationDataQueue[messageId.toLong()] = notificationData val callback = CallbackBuilder(fetchConversationWithMessagesCallback) .override("onFetchConversationWithMessagesComplete") { param ->