Skip to content

Commit

Permalink
Fix crash if Shared Element ID is invalid (#6511)
Browse files Browse the repository at this point in the history
Fixes a hard-crash on iOS if the specified Shared Element ID could not be found/invalid nativeID has been set

Co-authored-by: Yogev Ben David <[email protected]>
  • Loading branch information
mrousavy and yogevbd authored Sep 1, 2020
1 parent 0869fd0 commit fcf23d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ios/SharedElementTransitionsCreator.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ @implementation SharedElementTransitionsCreator
for (SharedElementTransitionOptions* transitionOptions in sharedElementTransitions) {
UIView *fromView = [RNNElementFinder findElementForId:transitionOptions.fromId inView:fromVC.reactView];
UIView *toView = [RNNElementFinder findElementForId:transitionOptions.toId inView:toVC.reactView];
if (fromView == nil || toView == nil) {
break;
}

SharedElementAnimator* sharedElementAnimator = [[SharedElementAnimator alloc] initWithTransitionOptions:transitionOptions
fromView:fromView
toView:toView
Expand Down

0 comments on commit fcf23d2

Please sign in to comment.