mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-09-19 16:24:41 +01:00
Fix crash when clearing KT.
This commit is contained in:
@@ -4476,10 +4476,15 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
}
|
||||
|
||||
fun clearSelfKeyTransparencyData() {
|
||||
val aci = SignalStore.account.aci
|
||||
if (aci == null) {
|
||||
Log.i(TAG, "Missing ACI, skipping clearing key transparency data.")
|
||||
return
|
||||
}
|
||||
val updated = writableDatabase
|
||||
.update(TABLE_NAME)
|
||||
.values(KEY_TRANSPARENCY_DATA to null)
|
||||
.where("$ACI_COLUMN = ? AND $KEY_TRANSPARENCY_DATA IS NOT NULL", Recipient.self().requireAci().toString())
|
||||
.where("$ACI_COLUMN = ? AND $KEY_TRANSPARENCY_DATA IS NOT NULL", aci.toString())
|
||||
.run() > 0
|
||||
Log.i(TAG, "Clearing self key transparency data $updated")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user