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:
Родитель
016bb24eac
Коммит
cabae397c6
|
@ -471,6 +471,10 @@ static void RCTSendScrollEventForNativeAnimations_DEPRECATED(UIScrollView *scrol
|
||||||
|
|
||||||
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
|
- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
|
||||||
{
|
{
|
||||||
|
if (!_eventEmitter) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_isUserTriggeredScrolling = NO;
|
_isUserTriggeredScrolling = NO;
|
||||||
static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onScrollToTop([self _scrollViewMetrics]);
|
static_cast<const ScrollViewEventEmitter &>(*_eventEmitter).onScrollToTop([self _scrollViewMetrics]);
|
||||||
[self _updateStateWithContentOffset];
|
[self _updateStateWithContentOffset];
|
||||||
|
|
Загрузка…
Ссылка в новой задаче