Avoid stack trace for empty icons

This commit is contained in:
Philipp Heckel 2022-11-27 20:24:10 -05:00
parent d09fdb2ff2
commit fa27fe9036
2 changed files with 2 additions and 2 deletions

View file

@ -50,7 +50,7 @@ class NotificationParser {
)
}
} else null
val icon: Icon? = if (message.icon != null) Icon(url = message.icon) else null
val icon: Icon? = if (message.icon != null && message.icon != "") Icon(url = message.icon) else null
val notification = Notification(
id = message.id,
subscriptionId = subscriptionId,

View file

@ -124,7 +124,7 @@ class FirebaseService : FirebaseMessagingService() {
url = attachmentUrl,
)
} else null
val icon: Icon? = iconUrl?.let { Icon(url = it) }
val icon: Icon? = if (iconUrl != null && iconUrl != "") Icon(url = iconUrl) else null
val notification = Notification(
id = id,
subscriptionId = subscription.id,