Skip to content

Commit 98a6166

Browse files
Dave MacLachlanmobile-devx-github-bot
authored andcommitted
A nil check to handle cases where otherPort is nil, preventing a crash.
PiperOrigin-RevId: 867326036
1 parent 9c4f9da commit 98a6166

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Service/Sources/EDOServicePort.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ - (void)encodeWithCoder:(NSCoder *)aCoder {
8787
}
8888

8989
- (BOOL)match:(EDOServicePort *)otherPort {
90+
if (!otherPort) {
91+
return NO;
92+
}
9093
// Ignore deviceSerial since it is not saved in the host side.
9194
BOOL isNameEqual = self.hostPort.name == otherPort.hostPort.name ||
9295
[self.hostPort.name isEqualToString:otherPort.hostPort.name];

0 commit comments

Comments
 (0)