From 176ece55122bc52140b8a31a62b3aa9e857d79db Mon Sep 17 00:00:00 2001 From: Emily Brown Date: Wed, 26 Nov 2025 02:58:02 -0800 Subject: [PATCH] Fix RCTDevLoadingView crash when adding button constraints (#54690) Summary: Changelog: [iOS][Fixed] - Fixed crash from dismiss button in DevLoadingView D86420230 added a dismiss button feature to RCTDevLoadingView. However, when adding layout constraints on line 198, it incorrectly checked the `dismissButton` parameter instead of the `self->_dismissButton` instance variable. This caused NSLayoutConstraint crashes when the parameter was nil/false but the instance variable existed from a previous call, or vice versa. This changes line 198 to check `self->_dismissButton` (the instance variable) instead of `dismissButton` (the function parameter) to properly verify if the button exists before adding constraints to it. Reviewed By: vzaidman, javache Differential Revision: D87871856 --- packages/react-native/React/CoreModules/RCTDevLoadingView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 103f7f52b7f1..07fe5e62ddc6 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -195,7 +195,7 @@ - (void)showMessage:(NSString *)message ]]; // Add button-specific constraints if button exists - if (dismissButton) { + if (self->_dismissButton != nullptr) { [constraints addObjectsFromArray:@[ [self->_dismissButton.trailingAnchor constraintEqualToAnchor:self->_container.trailingAnchor constant:-10], [self->_dismissButton.centerYAnchor constraintEqualToAnchor:self->_label.centerYAnchor],