mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
Fix possible crash when splitting contacts with invalid e164s.
This commit is contained in:
committed by
jeffrey-signal
parent
b7d671dcbd
commit
951d073ad6
@@ -2390,6 +2390,16 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
AppDependencies.databaseObserver.notifyRecipientChanged(id)
|
||||
}
|
||||
|
||||
if (record.e164 == null) {
|
||||
Log.w(TAG, "[WithSplit] Missing e164! Not adding the PNI/E164 record.")
|
||||
return
|
||||
}
|
||||
|
||||
if (!SignalE164Util.isPotentialE164(record.e164)) {
|
||||
Log.w(TAG, "[WithSplit] Invalid e164! Not adding the PNI/E164 record.")
|
||||
return
|
||||
}
|
||||
|
||||
val splitId = getAndPossiblyMerge(null, record.pni, record.e164)
|
||||
Log.i(TAG, "Split off new recipient as $splitId (ACI-only recipient is $id)")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user