mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
add nullptr check to avoid crash in RCTScrollViewComponentView (#42156)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42156 changelog: [internal] Add a missing nullptr check to prevent crash if called after component was reused Reviewed By: fkgozali Differential Revision: D52572807 fbshipit-source-id: 1b5b26996e562abbcb986865299e02df20b58043
This commit is contained in:
committed by
Facebook GitHub Bot
parent
016bb24eac
commit
cabae397c6
+4
@@ -471,6 +471,10 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
||||
|
||||
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
|
||||
{
|
||||
if (!_eventEmitter) {
|
||||
return;
|
||||
}
|
||||
|
||||
_isUserTriggeredScrolling = NO;
|
||||
static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onScrollToTop([self _scrollViewMetrics]);
|
||||
[self _updateStateWithContentOffset];
|
||||
|
||||
Reference in New Issue
Block a user