Skip to content

Commit

Permalink
Fix: [Fabric] [iOS] Fix app crash when selecting an empty value (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj authored May 19, 2024
1 parent 7b7a95f commit 09026e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ios/RNCPicker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ - (void)pickerView:(__unused UIPickerView *)pickerView
std::dynamic_pointer_cast<const facebook::react::RNCPickerEventEmitter>(eventEmitter)
->onChange(facebook::react::RNCPickerEventEmitter::OnChange{
.newIndex = (int)row,
.newValue = RCTStringFromNSString(RCTNullIfNil(_items[row][@"value"])),
.newValue = RCTStringFromNSString(_items[row][@"value"]),
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion ios/RNCPickerComponentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
for (RNCPickerItemsStruct item : newProps.items)
{
NSMutableDictionary *dictItem = [NSMutableDictionary new];
dictItem[@"value"] = RCTNSStringFromStringNilIfEmpty(item.value);
dictItem[@"value"] = RCTNSStringFromString(item.value);
dictItem[@"label"] = RCTNSStringFromStringNilIfEmpty(item.label);
dictItem[@"textColor"] = RCTUIColorFromSharedColor(item.textColor);
dictItem[@"testID"] = RCTNSStringFromStringNilIfEmpty(item.testID);
Expand Down

0 comments on commit 09026e1

Please sign in to comment.