From d09cb63805387021977c3c3d28ea4fa7a755e471 Mon Sep 17 00:00:00 2001 From: Dave MacLachlan Date: Mon, 9 Feb 2026 10:05:48 -0800 Subject: [PATCH] A nil check to handle cases where `otherPort` is nil, preventing a crash. PiperOrigin-RevId: 867656307 --- Service/Sources/EDOServicePort.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Service/Sources/EDOServicePort.m b/Service/Sources/EDOServicePort.m index b4ceee1..f56e7ed 100644 --- a/Service/Sources/EDOServicePort.m +++ b/Service/Sources/EDOServicePort.m @@ -87,6 +87,9 @@ - (void)encodeWithCoder:(NSCoder *)aCoder { } - (BOOL)match:(EDOServicePort *)otherPort { + if (!otherPort) { + return NO; + } // Ignore deviceSerial since it is not saved in the host side. BOOL isNameEqual = self.hostPort.name == otherPort.hostPort.name || [self.hostPort.name isEqualToString:otherPort.hostPort.name];