Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
Summary: blocks don't capture C++ objects so this will would crash

Reviewed By: sammy-SC, cipolleschi

Differential Revision: D53572123

fbshipit-source-id: 323f29c30d99616080aef6b0a895df4599788395
  • Loading branch information
philIip authored and facebook-github-bot committed Feb 8, 2024
1 parent 2ca7bec commit b796cda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/React/CoreModules/RCTAlertManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ - (void)invalidate
NSString *destructiveButtonKey = [RCTConvert NSString:args.destructiveButtonKey()];
NSString *preferredButtonKey = [RCTConvert NSString:args.preferredButtonKey()];
UIKeyboardType keyboardType = [RCTConvert UIKeyboardType:args.keyboardType()];
UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];

if (!title && !message) {
RCTLogError(@"Must specify either an alert title, or message, or both");
Expand All @@ -108,7 +109,6 @@ - (void)invalidate
message:nil
preferredStyle:UIAlertControllerStyleAlert];

UIUserInterfaceStyle userInterfaceStyle = [RCTConvert UIUserInterfaceStyle:args.userInterfaceStyle()];
alertController.overrideUserInterfaceStyle = userInterfaceStyle;

switch (type) {
Expand Down

0 comments on commit b796cda

Please sign in to comment.