Fixed crash if messages list is null in notification (even if it shouldn't happen)

This commit is contained in:
Sylvain Berfini 2021-03-01 11:30:42 +01:00
parent cd4b8b8ac5
commit 712852cdce

View file

@ -671,7 +671,7 @@ class NotificationsManager(private val context: Context) {
): Notification {
val me = Person.Builder().setName(notifiable.myself).build()
val style = NotificationCompat.MessagingStyle(me)
val largeIcon: Bitmap? = notifiable.messages.last().senderAvatar
val largeIcon: Bitmap? = notifiable.messages.lastOrNull()?.senderAvatar
var lastPerson: Person? = null
for (message in notifiable.messages) {