From 860e6c255bc5a93d2845fca0bea2bc87ea9bdf6a Mon Sep 17 00:00:00 2001 From: Naveen Date: Sun, 4 Dec 2022 23:23:16 +0530 Subject: [PATCH] Minor code improvement --- .../smsmessenger/helpers/NotificationHelper.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt index 45fcae7b..0a226824 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt @@ -170,7 +170,9 @@ class NotificationHelper(private val context: Context) { .setName(name) .setKey(address) .build() - } else null + } else { + null + } return NotificationCompat.MessagingStyle(user).also { style -> getOldMessages(notificationId).forEach { @@ -188,7 +190,7 @@ class NotificationHelper(private val context: Context) { val currentNotification = notificationManager.activeNotifications.find { it.id == notificationId } return if (currentNotification != null) { val activeStyle = NotificationCompat.MessagingStyle.extractMessagingStyleFromNotification(currentNotification.notification) - return activeStyle?.messages.orEmpty() + activeStyle?.messages.orEmpty() } else { emptyList() }