Skip to content

Commit

Permalink
Make implementing handleBDXTransferSessionEndForNodeID actually optio…
Browse files Browse the repository at this point in the history
…nal. (#25871)

It's marked @optional in the API, but we're calling it unconditionally.
  • Loading branch information
bzbarsky-apple authored Mar 29, 2023
1 parent cefa2fe commit 1b5e18b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,13 @@ CHIP_ERROR OnTransferSessionEnd(TransferSession::OutputEvent & event)
auto nodeId = @(mNodeId.Value());

auto strongDelegate = mDelegate;
dispatch_async(mDelegateNotificationQueue, ^{
[strongDelegate handleBDXTransferSessionEndForNodeID:nodeId
controller:controller
error:[MTRError errorForCHIPErrorCode:error]];
});
if ([strongDelegate respondsToSelector:@selector(handleBDXTransferSessionEndForNodeID:controller:error:)]) {
dispatch_async(mDelegateNotificationQueue, ^{
[strongDelegate handleBDXTransferSessionEndForNodeID:nodeId
controller:controller
error:[MTRError errorForCHIPErrorCode:error]];
});
}

ResetState();
return CHIP_NO_ERROR;
Expand Down

0 comments on commit 1b5e18b

Please sign in to comment.