diff --git a/packages/react-native/scripts/cocoapods/privacy_manifest_utils.rb b/packages/react-native/scripts/cocoapods/privacy_manifest_utils.rb index 2f4cac1f8bab2b..35229c481f1955 100644 --- a/packages/react-native/scripts/cocoapods/privacy_manifest_utils.rb +++ b/packages/react-native/scripts/cocoapods/privacy_manifest_utils.rb @@ -106,10 +106,11 @@ def self.get_used_required_reason_apis(installer) content = Xcodeproj::Plist.read_from_path(file_path) accessed_api_types = content["NSPrivacyAccessedAPITypes"] accessed_api_types.each do |accessed_api| - api_type = accessed_api["NSPrivacyAccessedAPIType"] - reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"] - used_apis[api_type] ||= [] - used_apis[api_type] += reasons + api_type = accessed_api["NSPrivacyAccessedAPIType"] + reasons = accessed_api["NSPrivacyAccessedAPITypeReasons"] + next unless api_type + used_apis[api_type] ||= [] + used_apis[api_type] += reasons end end end