Skip to content

Commit

Permalink
Fix procs handling by removing parentNode check (#541)
Browse files Browse the repository at this point in the history
In procs it happens, that parent might not be present and this should not be breaking
  • Loading branch information
osdnk committed Jan 8, 2020
1 parent 1ea8cc3 commit 513ff6f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,6 @@ public void dropNode(int tag) {

public void connectNodes(int parentID, int childID) {
Node parentNode = mAnimatedNodes.get(parentID);
if (parentNode == null) {
throw new JSApplicationIllegalArgumentException("Animated node with ID " + parentID +
" does not exists");
}
Node childNode = mAnimatedNodes.get(childID);
if (childNode == null) {
throw new JSApplicationIllegalArgumentException("Animated node with ID " + childID +
Expand All @@ -299,10 +295,6 @@ public void connectNodes(int parentID, int childID) {

public void disconnectNodes(int parentID, int childID) {
Node parentNode = mAnimatedNodes.get(parentID);
if (parentNode == null) {
throw new JSApplicationIllegalArgumentException("Animated node with ID " + parentID +
" does not exists");
}
Node childNode = mAnimatedNodes.get(childID);
if (childNode == null) {
throw new JSApplicationIllegalArgumentException("Animated node with ID " + childID +
Expand Down
2 changes: 0 additions & 2 deletions ios/REANodesManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ - (void)connectNodes:(nonnull NSNumber *)parentID childID:(nonnull REANodeID)chi
REANode *parentNode = _nodes[parentID];
REANode *childNode = _nodes[childID];

RCTAssertParam(parentNode);
RCTAssertParam(childNode);

[parentNode addChild:childNode];
Expand All @@ -284,7 +283,6 @@ - (void)disconnectNodes:(REANodeID)parentID childID:(REANodeID)childID
REANode *parentNode = _nodes[parentID];
REANode *childNode = _nodes[childID];

RCTAssertParam(parentNode);
RCTAssertParam(childNode);

[parentNode removeChild:childNode];
Expand Down

0 comments on commit 513ff6f

Please sign in to comment.