Skip to content

Commit

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

## 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 Mar 8, 2024
1 parent 59c0425 commit da44b91
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 da44b91

Please sign in to comment.