Skip to content

Commit

Permalink
Merge pull request #561 from JanC/462-fix
Browse files Browse the repository at this point in the history
Fix for undefined method `isa' for nil:NilClass (NoMethodError)
  • Loading branch information
segiddins committed Apr 13, 2018
2 parents aac57c4 + 196d457 commit 2bd7a54
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#565](https://github.com/CocoaPods/Xcodeproj/pull/565)

* Fixed `undefined method isa for nil:NilClass` when deleting a Xcodeproj target.
[JanC](https://github.com/JanC)
[#462](https://github.com/CocoaPods/Xcodeproj/issues/462)

## 1.5.7 (2018-03-22)

Expand Down
6 changes: 5 additions & 1 deletion lib/xcodeproj/project/object/configuration_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ def target
#---------------------------------------------------------------------#

def ascii_plist_annotation
" Build configuration list for #{target.isa} \"#{target}\" "
if target.nil?
' Build configuration list for <deleted target> '
else
" Build configuration list for #{target.isa} \"#{target}\" "
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions spec/project/object/configuration_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ module ProjectSpecs
@configuration_list.build_settings('Debug').should == settings
end

it 'returns the ascii plist annotation given a deleted target ' do
@configuration_list.ascii_plist_annotation.should == ' Build configuration list for <deleted target> '
end

it 'sets a build setting to the given value for all the configurations' do
%w(Debug Release).each do |name|
configuration = @project.new(XCBuildConfiguration)
Expand Down

0 comments on commit 2bd7a54

Please sign in to comment.