Skip to content

Commit

Permalink
Fixed crash on attempt to update local data of deallocated shadow node
Browse files Browse the repository at this point in the history
Summary:
Trivial.
That's okay that sometimes shadowNodes and views hierarchies have lack of synchonization.

Reviewed By: sahrens

Differential Revision: D6040022

fbshipit-source-id: 6b49a82317b620b66a87441719fddcafb1f27934
  • Loading branch information
shergin authored and facebook-github-bot committed Oct 12, 2017
1 parent 452ac1b commit f2c6877
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,10 @@ public void setViewLocalData(int tag, Object data) {
ReactShadowNode shadowNode = mShadowNodeRegistry.getNode(tag);

if (shadowNode == null) {
throw new IllegalViewOperationException(
"Trying to set local data for view with unknown tag: " + tag);
FLog.w(
ReactConstants.TAG,
"Attempt to set local data for view with unknown tag: " + tag);
return;
}

shadowNode.setLocalData(data);
Expand Down

5 comments on commit f2c6877

@meros
Copy link

@meros meros commented on f2c6877 Nov 15, 2017

Choose a reason for hiding this comment

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

If it's ok that they are not in sync. Why is there a warning at all?

@ebaynaud
Copy link

Choose a reason for hiding this comment

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

Couldn't this backported to 0.50.x?

@aaronfreeman
Copy link

Choose a reason for hiding this comment

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

It would be great to backport this to 0.50.x. This is currently blocking a deploy for us. I either have to try to go back to 0.49 or release with a 0.51 RC.

@sibelius
Copy link

Choose a reason for hiding this comment

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

this is great to hear

@luo-wenfeng
Copy link

Choose a reason for hiding this comment

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

Great

Please sign in to comment.