mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 16:19:33 +01:00
Fix missing UUID crash in storage service.
This commit is contained in:
@@ -1220,7 +1220,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
val out: MutableMap<RecipientId, StorageId> = HashMap()
|
||||
|
||||
readableDatabase
|
||||
.select(ID, STORAGE_SERVICE_ID, TYPE)
|
||||
.select(ID, STORAGE_SERVICE_ID, TYPE, ACI_COLUMN, PNI_COLUMN)
|
||||
.from(TABLE_NAME)
|
||||
.where(
|
||||
"""
|
||||
@@ -1251,7 +1251,15 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
val key = Base64.decodeOrThrow(encodedKey)
|
||||
|
||||
when (recipientType) {
|
||||
RecipientType.INDIVIDUAL -> out[id] = StorageId.forContact(key)
|
||||
RecipientType.INDIVIDUAL -> {
|
||||
val aci = ACI.parseOrNull(cursor.requireString(ACI_COLUMN))
|
||||
val pni = PNI.parseOrNull(cursor.requireString(PNI_COLUMN))
|
||||
if (aci == null && pni == null) {
|
||||
Log.w(TAG, "All identifiers are null! Skipping. Before parsing, ACI: ${cursor.requireString(ACI_COLUMN) != null}, PNI: ${cursor.requireString(PNI_COLUMN) != null}")
|
||||
} else {
|
||||
out[id] = StorageId.forContact(key)
|
||||
}
|
||||
}
|
||||
RecipientType.GV1 -> out[id] = StorageId.forGroupV1(key)
|
||||
RecipientType.DISTRIBUTION_LIST -> out[id] = StorageId.forStoryDistributionList(key)
|
||||
RecipientType.CALL_LINK -> out[id] = StorageId.forCallLink(key)
|
||||
|
||||
Reference in New Issue
Block a user