Skip to content

Commit

Permalink
Handle invalidation error in RCTObjcExecutor
Browse files Browse the repository at this point in the history
Differential Revision: D6748200

fbshipit-source-id: eb98782c2ba080273c1f027846984f5f4caddf26
  • Loading branch information
fromcelticpark authored and facebook-github-bot committed Jan 18, 2018
1 parent 65184ec commit 493f3e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion React/CxxBridge/RCTObjcExecutor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@
{
m_jsCallback = ^(id json, NSError *error) {
if (error) {
m_errorBlock(error);
// Do not use "m_errorBlock" here as the bridge might be in the middle
// of invalidation as a result of error handling and "this" can be
// already deallocated.
errorBlock(error);
return;
}

Expand Down

1 comment on commit 493f3e8

@aleclarson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fromcelticpark Thank you for this! ❤️

Please sign in to comment.