We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f509f67 commit 3e6de54Copy full SHA for 3e6de54
src/darwin/Framework/CHIP/MTRDevice.mm
@@ -305,6 +305,15 @@ - (void)dealloc
305
306
+ (MTRDevice *)deviceWithNodeID:(NSNumber *)nodeID controller:(MTRDeviceController *)controller
307
{
308
+ if (nodeID == nil || controller == nil) {
309
+ // These are not nullable in our API, but clearly someone is not
310
+ // actually turning on the relevant compiler checks (or is doing dynamic
311
+ // dispatch with bad values). While we promise to not return nil from
312
+ // this method, if the caller is ignoring the nullability API contract,
313
+ // there's not much we can do here.
314
+ return nil;
315
+ }
316
+
317
return [controller deviceForNodeID:nodeID];
318
}
319
0 commit comments