Fix some UP crashes
Change-Id: I16f47f86a58c23210cc99c85081da1703bbda5ac
This commit is contained in:
parent
d1379377b1
commit
38212b6410
|
@ -51,6 +51,7 @@ import org.unifiedpush.android.connector.MessagingReceiver
|
||||||
import org.unifiedpush.android.connector.MessagingReceiverHandler
|
import org.unifiedpush.android.connector.MessagingReceiverHandler
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
|
@JsonClass(generateAdapter = true)
|
||||||
data class UnifiedPushMessage(
|
data class UnifiedPushMessage(
|
||||||
val notification: Notification
|
val notification: Notification
|
||||||
)
|
)
|
||||||
|
@ -117,10 +118,10 @@ val upHandler = object: MessagingReceiverHandler {
|
||||||
|
|
||||||
if (UPHelper.isEmbeddedDistributor(context)) {
|
if (UPHelper.isEmbeddedDistributor(context)) {
|
||||||
notification = moshi.adapter(Notification::class.java)
|
notification = moshi.adapter(Notification::class.java)
|
||||||
.fromJson(message)!!
|
.fromJson(message) ?: return
|
||||||
} else {
|
} else {
|
||||||
val data = moshi.adapter(UnifiedPushMessage::class.java)
|
val data = moshi.adapter(UnifiedPushMessage::class.java)
|
||||||
.fromJson(message)!!
|
.fromJson(message) ?: return
|
||||||
notification = data.notification
|
notification = data.notification
|
||||||
notification.unread = notification.counts.unread
|
notification.unread = notification.counts.unread
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue