mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fix PNI crash in in group processing.
This commit is contained in:
committed by
Alex Hart
parent
dc095c9db4
commit
9bc4dfc3f6
@@ -111,8 +111,8 @@ internal class AccountValues internal constructor(store: KeyValueStore) : Signal
|
||||
putString(KEY_PNI, pni.toString())
|
||||
}
|
||||
|
||||
fun requireServiceIds(): ServiceIds {
|
||||
return ServiceIds(requireAci(), requirePni())
|
||||
fun getServiceIds(): ServiceIds {
|
||||
return ServiceIds(requireAci(), pni)
|
||||
}
|
||||
|
||||
/** The local user's E164. */
|
||||
|
||||
@@ -10,13 +10,13 @@ import java.util.UUID
|
||||
* Helper for dealing with [ServiceId] matching when you only care that either of your
|
||||
* service ids match but don't care which one.
|
||||
*/
|
||||
data class ServiceIds(val aci: ACI, val pni: PNI) {
|
||||
data class ServiceIds(val aci: ACI, val pni: PNI?) {
|
||||
|
||||
private val aciByteString: ByteString by lazy { UuidUtil.toByteString(aci.uuid()) }
|
||||
private val pniByteString: ByteString by lazy { UuidUtil.toByteString(pni.uuid()) }
|
||||
private val pniByteString: ByteString? by lazy { pni?.let { UuidUtil.toByteString(it.uuid()) } }
|
||||
|
||||
fun matches(uuid: UUID): Boolean {
|
||||
return uuid == aci.uuid() || uuid == pni.uuid()
|
||||
return uuid == aci.uuid() || uuid == pni?.uuid()
|
||||
}
|
||||
|
||||
fun matches(uuid: ByteString): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user