[Feedback] Fix crashing when null message is received.

This commit is contained in:
Kuba Szczodrzyński 2020-02-09 23:03:37 +01:00
parent 57a8d72f1c
commit 4717b4549e

View File

@ -47,7 +47,7 @@ class SzkolnyAppFirebase(val app: App, val profiles: List<Profile>, val message:
) )
"appUpdate" -> launch { UpdateWorker.runNow(app, app.gson.fromJson(message.data.getString("update"), Update::class.java)) } "appUpdate" -> launch { UpdateWorker.runNow(app, app.gson.fromJson(message.data.getString("update"), Update::class.java)) }
"feedbackMessage" -> launch { "feedbackMessage" -> launch {
val message = app.gson.fromJson(message.data.getString("message"), FeedbackMessage::class.java) val message = app.gson.fromJson(message.data.getString("message"), FeedbackMessage::class.java) ?: return@launch
feedbackMessage(message) feedbackMessage(message)
} }
} }