diff --git a/vector/src/main/java/im/vector/app/core/pushers/VectorMessagingReceiver.kt b/vector/src/main/java/im/vector/app/core/pushers/VectorMessagingReceiver.kt index acfe22cb11..04d4cfeb0e 100755 --- a/vector/src/main/java/im/vector/app/core/pushers/VectorMessagingReceiver.kt +++ b/vector/src/main/java/im/vector/app/core/pushers/VectorMessagingReceiver.kt @@ -51,6 +51,7 @@ import org.unifiedpush.android.connector.MessagingReceiver import org.unifiedpush.android.connector.MessagingReceiverHandler import timber.log.Timber +@JsonClass(generateAdapter = true) data class UnifiedPushMessage( val notification: Notification ) @@ -117,10 +118,10 @@ val upHandler = object: MessagingReceiverHandler { if (UPHelper.isEmbeddedDistributor(context)) { notification = moshi.adapter(Notification::class.java) - .fromJson(message)!! + .fromJson(message) ?: return } else { val data = moshi.adapter(UnifiedPushMessage::class.java) - .fromJson(message)!! + .fromJson(message) ?: return notification = data.notification notification.unread = notification.counts.unread }