forked from upstream-mirrors/quik
Fix error when receiving messages without valid body
This commit is contained in:
@@ -53,8 +53,8 @@ class ReceiveSms @Inject constructor(
|
|||||||
val address = messages[0].displayOriginatingAddress
|
val address = messages[0].displayOriginatingAddress
|
||||||
val time = messages[0].timestampMillis
|
val time = messages[0].timestampMillis
|
||||||
val body: String = messages
|
val body: String = messages
|
||||||
.map { message -> message.displayMessageBody }
|
.mapNotNull { message -> message.displayMessageBody }
|
||||||
.reduce { body, new -> body + new }
|
.reduce { body, new -> body + new } ?: ""
|
||||||
|
|
||||||
messageRepo.insertReceivedSms(it.subId, address, body, time) // Add the message to the db
|
messageRepo.insertReceivedSms(it.subId, address, body, time) // Add the message to the db
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user