mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
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 time = messages[0].timestampMillis
|
||||
val body: String = messages
|
||||
.map { message -> message.displayMessageBody }
|
||||
.reduce { body, new -> body + new }
|
||||
.mapNotNull { message -> message.displayMessageBody }
|
||||
.reduce { body, new -> body + new } ?: ""
|
||||
|
||||
messageRepo.insertReceivedSms(it.subId, address, body, time) // Add the message to the db
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user