Skip to content

Commit

Permalink
added class check in debug
Browse files Browse the repository at this point in the history
  • Loading branch information
alduzy committed Oct 7, 2024
1 parent 282b86d commit ea77267
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ios/RNSScreenStackHeaderSubview.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ @implementation RNSScreenStackHeaderSubview

#pragma mark - Common

- (RNSScreenStackHeaderConfig *)getHeaderConfig
- (nullable RNSScreenStackHeaderConfig *)getHeaderConfig
{
RNSScreenStackHeaderConfig *headerConfig = (RNSScreenStackHeaderConfig *)self.reactSuperview;
RNSScreenStackHeaderConfig *headerConfig = (RNSScreenStackHeaderConfig *_Nullable)self.reactSuperview;
#ifdef DEBUG
if (headerConfig != nil && ![headerConfig isKindOfClass:[RNSScreenStackHeaderConfig class]]) {
RCTLogError(@"[RNScreens] Invalid view type, expecting RNSScreenStackHeaderConfig, got: %@", headerConfig);
return nil;
}
#endif
return headerConfig;
}

Expand Down

0 comments on commit ea77267

Please sign in to comment.