Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when retrieve subspec from a unavailable podspec file #742

Merged
merged 2 commits into from
Dec 24, 2023

Conversation

sagiwei
Copy link
Contributor

@sagiwei sagiwei commented Jun 9, 2023

When install a subspec such as AFNetworking/Reachability with no version range is specified:

pod 'AFNetworking/Reachability'

Cocoapods will crashed:

NoMethodError - undefined method `downcase' for nil:NilClass

Same issue mentioned here: CocoaPods/CocoaPods#11733


After some research, I found it caused by AFNetworking (= 1.1.1), this podspec.json has empty contents:

{
  "deprecated_in_favor_of": "Alamofire",
  "platforms": {
    "osx": null,
    "ios": null,
    "tvos": null,
    "watchos": null
  }
}

so I add some check code in subspec_by_name method, and now no more crash occurs.

@amorde amorde merged commit d756e4c into CocoaPods:master Dec 24, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants