Skip to content

Commit fab7fa8

Browse files
javachefacebook-github-bot
authored andcommitted
Correctly compare oldProps in RCTPullToRefreshViewComponentView (#50092)
Summary: Pull Request resolved: #50092 `oldProps` can be null, so this is an unsafe dereference. We also typically compare with `_props`, which represents the previous state of the component. Changelog: [General][Fixed] Fixed crash in RCTPullToRefreshViewComponentView#updateProps Reviewed By: cipolleschi Differential Revision: D71388015 fbshipit-source-id: deff9c581ee207c4481056a720c10dfd661f088d
1 parent 1f0b27a commit fab7fa8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
7676
return;
7777
}
7878

79-
const auto &oldConcreteProps = static_cast<const PullToRefreshViewProps &>(*oldProps);
79+
const auto &oldConcreteProps = static_cast<const PullToRefreshViewProps &>(*_props);
8080
const auto &newConcreteProps = static_cast<const PullToRefreshViewProps &>(*props);
8181

8282
if (newConcreteProps.tintColor != oldConcreteProps.tintColor) {

0 commit comments

Comments
 (0)