Fix potential crash during contact splits.

This commit is contained in:
Greyson Parrelli
2024-01-31 19:39:36 -05:00
parent 7abff55981
commit 9d1514308a

View File

@@ -2248,7 +2248,10 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
*/
fun splitForStorageSync(storageId: ByteArray) {
val record = getByStorageId(storageId)!!
check(record.aci != null && record.pni != null)
if (record.aci == null || record.pni == null) {
Log.w(TAG, "Invalid state for split, ignoring.")
return
}
writableDatabase
.update(TABLE_NAME)