Skip to content

Commit

Permalink
Add explicitly if messageType is not present it will return null
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopsaheysa committed Jun 14, 2024
1 parent 0fb5826 commit 5b76e83
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class PushParser {
@JvmStatic
@JvmName("parseNotification")
fun parseNotification(notificationData: Map<String, String>): PushMessage? {
return when (notificationData["messageType"]) {
val messageType = notificationData["messageType"] ?: return null

return when (messageType) {
"mtoken.operationInit" -> parseOperationCreated(notificationData)
"mtoken.operationFinished" -> parseOperationFinished(notificationData)
"mtoken.inboxMessage.new" -> parseInboxMessageReceived(notificationData)
Expand Down

0 comments on commit 5b76e83

Please sign in to comment.