Skip to content

Commit

Permalink
fix(iOS): Add view check for getting StackView in goBackGesture (so…
Browse files Browse the repository at this point in the history
…ftware-mansion#2060)

## Description

This PR fixes problem with goBackGesture screen transition. If stackView
can not be found, transition just shouldn't start instead of crashing
app and throwing the `Invalid view type, expecting RNSScreenStackView`
error.

## Checklist

- [x] Ensured that CI passes
  • Loading branch information
piaskowyk authored and ja1ns committed Oct 9, 2024
1 parent 4fad547 commit c241c31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/RNSModule.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ - (void)disableSwipeBackForTopScreen:(NSNumber *)stackTag
- (RNSScreenStackView *)getStackView:(NSNumber *)stackTag
{
RNSScreenStackView *view = [self getScreenStackView:stackTag];
if (![view isKindOfClass:[RNSScreenStackView class]]) {
if (view != nil && ![view isKindOfClass:[RNSScreenStackView class]]) {
RCTLogError(@"Invalid view type, expecting RNSScreenStackView, got: %@", view);
return nil;
}
Expand Down

0 comments on commit c241c31

Please sign in to comment.