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 and pull[bot] committed Jan 22, 2024
1 parent cf5f1ed commit 1217532
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 1217532

Please sign in to comment.