Permalink
Browse files

Fixed crash on attempt to update local data of deallocated shadow node

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 f2c6877b91963878f36ec42f5f865427bc69488c
Showing with 4 additions and 2 deletions.
  1. +4 −2 ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java
@@ -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);

5 comments on commit f2c6877

@meros

This comment has been minimized.

Show comment
Hide comment
@meros

meros Nov 15, 2017

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

meros replied Nov 15, 2017

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

@ebaynaud

This comment has been minimized.

Show comment
Hide comment
@ebaynaud

ebaynaud Nov 29, 2017

Couldn't this backported to 0.50.x?

ebaynaud replied Nov 29, 2017

Couldn't this backported to 0.50.x?

@aaronfreeman

This comment has been minimized.

Show comment
Hide comment
@aaronfreeman

aaronfreeman Nov 29, 2017

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.

aaronfreeman replied Nov 29, 2017

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

This comment has been minimized.

Show comment
Hide comment
@sibelius

sibelius Dec 1, 2017

this is great to hear

sibelius replied Dec 1, 2017

this is great to hear

@luo-wenfeng

This comment has been minimized.

Show comment
Hide comment
@luo-wenfeng

luo-wenfeng replied Dec 25, 2017

Great

Please sign in to comment.