Commit 16c7d9c9 authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #5827 from marcelofabri/acknowledgements-crash

[Acknowledgements] Prevent crash when license type is nil
parents 62f140f1 af66f439
......@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* None.
* Prevent crash when generating acknowledgements when license type is not specified.
[Marcelo Fabri](https://github.com/marcelofabri)
[#5826](https://github.com/CocoaPods/CocoaPods/issues/5826)
## 1.1.0.beta.2 (2016-09-03)
......
......@@ -33,12 +33,14 @@ module Pod
def hash_for_spec(spec)
if (license = license_text(spec))
{
hash = {
:Type => 'PSGroupSpecifier',
:Title => sanitize_encoding(spec.name),
:FooterText => sanitize_encoding(license),
:License => sanitize_encoding(spec.license[:type]),
}
hash[:License] = sanitize_encoding(spec.license[:type]) if spec.license[:type]
hash
end
end
......
......@@ -29,6 +29,15 @@ describe Pod::Generator::Plist do
}
end
it 'skips license type in hash when it is nil' do
@spec.stubs(:license).returns(:type => nil)
@generator.hash_for_spec(@spec).should == {
:Type => 'PSGroupSpecifier',
:Title => 'POD_NAME',
:FooterText => 'LICENSE_TEXT',
}
end
it 'returns a correctly sanitized license hash for each pod' do
license_text = 'Copyright © 2013–2014 Boris Bügling'
@generator.stubs(:license_text).returns(license_text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment