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

undefined method `to_tree_hash' for nil:NilClass (NoMethodError) #106

Closed
igorkulman opened this issue Jul 5, 2023 · 1 comment · Fixed by #107
Closed

undefined method `to_tree_hash' for nil:NilClass (NoMethodError) #106

igorkulman opened this issue Jul 5, 2023 · 1 comment · Fixed by #107

Comments

@igorkulman
Copy link

igorkulman commented Jul 5, 2023

I got this error running 0.7.1 installed from brew

❯ kintsugi Sources/iOSSampleApp.xcodeproj/project.pbxproj
Traceback (most recent call last):
	16: from /Users/igorkulman/.rbenv/versions/2.7.7/bin/kintsugi:23:in `<main>'
	15: from /Users/igorkulman/.rbenv/versions/2.7.7/bin/kintsugi:23:in `load'
	14: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/kintsugi-0.7.1/bin/kintsugi:10:in `<top (required)>'
	13: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/kintsugi-0.7.1/lib/kintsugi.rb:26:in `run'
	12: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/kintsugi-0.7.1/lib/kintsugi/cli.rb:207:in `block in create_root_command'
	11: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/kintsugi-0.7.1/lib/kintsugi/merge.rb:39:in `resolve_conflicts'
	10: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/differ.rb:65:in `project_diff'
	 9: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:328:in `to_tree_hash'
	 8: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:452:in `to_tree_hash'
	 7: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:452:in `each'
	 6: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:454:in `block in to_tree_hash'
	 5: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:454:in `map'
	 4: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:452:in `to_tree_hash'
	 3: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:452:in `each'
	 2: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:454:in `block in to_tree_hash'
	 1: from /Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object.rb:454:in `map'
/Users/igorkulman/.rbenv/versions/2.7.7/lib/ruby/gems/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project/object/target_dependency.rb:83:in `to_tree_hash': undefined method `to_tree_hash' for nil:NilClass (NoMethodError)

attaching the conflicted project file

project.pbxproj.zip

@byohay
Copy link
Collaborator

byohay commented Jul 14, 2023

Hey! The crash happened in https://github.com/CocoaPods/Xcodeproj, when trying to calculate the project diff.
I found out that it's code I introduced back in 2020, so I fixed it here 😄

@byohay byohay linked a pull request Aug 9, 2023 that will close this issue
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 a pull request may close this issue.

2 participants