Fix crash when registering with an existing recipient with the same PNI.

This commit is contained in:
Cody Henthorne
2022-01-24 17:02:09 -05:00
committed by Alex Hart
parent 8648c74221
commit 15254ee720
2 changed files with 10 additions and 0 deletions

View File

@@ -1747,6 +1747,7 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) :
private fun removePhoneNumber(recipientId: RecipientId, db: SQLiteDatabase) {
val values = ContentValues().apply {
putNull(PHONE)
putNull(PNI_COLUMN)
}
db.update(TABLE_NAME, values, ID_WHERE, SqlUtil.buildArgs(recipientId))
}