fix: ensure valid column index (#462)
* fix: ensure valid column index See: https://github.com/FossifyOrg/Messages/issues/461 * refactor: use extension from commons * docs: update changelog
This commit is contained in:
parent
fb7a394478
commit
ce5b35737f
2 changed files with 11 additions and 1 deletions
|
|
@ -30,6 +30,7 @@ import me.leolin.shortcutbadger.ShortcutBadger
|
|||
import org.fossify.commons.extensions.areDigitsOnly
|
||||
import org.fossify.commons.extensions.getBlockedNumbers
|
||||
import org.fossify.commons.extensions.getIntValue
|
||||
import org.fossify.commons.extensions.getIntValueOr
|
||||
import org.fossify.commons.extensions.getLongValue
|
||||
import org.fossify.commons.extensions.getMyContactsCursor
|
||||
import org.fossify.commons.extensions.getStringValue
|
||||
|
|
@ -161,7 +162,11 @@ fun Context.getMessages(
|
|||
val date = (cursor.getLongValue(Sms.DATE) / 1000).toInt()
|
||||
val read = cursor.getIntValue(Sms.READ) == 1
|
||||
val thread = cursor.getLongValue(Sms.THREAD_ID)
|
||||
val subscriptionId = cursor.getIntValue(Sms.SUBSCRIPTION_ID)
|
||||
val subscriptionId = cursor.getIntValueOr(
|
||||
key = Sms.SUBSCRIPTION_ID,
|
||||
defaultValue = SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
)
|
||||
|
||||
val status = cursor.getIntValue(Sms.STATUS)
|
||||
val participants = senderNumber.split(ADDRESS_SEPARATOR).map { number ->
|
||||
val phoneNumber = PhoneNumber(number, 0, "", number)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue