From 09d75ee2d54ed8bfdf4376b624bbe2262a174ed1 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 26 Jun 2019 14:49:55 -0600 Subject: [PATCH] fixup address comparison with nil uuid --- .../src/Contacts/SignalServiceAddress.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SignalServiceKit/src/Contacts/SignalServiceAddress.swift b/SignalServiceKit/src/Contacts/SignalServiceAddress.swift index d83d4e35ee..c4588f4324 100644 --- a/SignalServiceKit/src/Contacts/SignalServiceAddress.swift +++ b/SignalServiceKit/src/Contacts/SignalServiceAddress.swift @@ -60,7 +60,16 @@ public class SignalServiceAddress: NSObject { return false } - return otherAddress.uuid == uuid || otherAddress.phoneNumber == phoneNumber + if let otherUuid = otherAddress.uuid, let thisUuid = uuid { + return otherUuid == thisUuid + } + + if let otherPhone = otherAddress.phoneNumber, let thisPhone = phoneNumber { + return otherPhone == thisPhone + } + + owsFailDebug("otherAddress had neither uuid nor phone") + return false } @objc