Commit 63798e2b authored by Fabio Pelosin's avatar Fabio Pelosin

[TargetIntegrator] Robustness against target with missing file references

Closes #938
parent b8e6999f
......@@ -55,7 +55,9 @@ module Pod
non_integrated = targets.reject do |target|
target.frameworks_build_phase.files.any? do |build_file|
file_ref = build_file.file_ref
file_ref.isa == 'PBXFileReference' && file_ref.display_name == library.product_name
file_ref &&
file_ref.isa == 'PBXFileReference' &&
file_ref.display_name == library.product_name
end
end
@targets = non_integrated
......
......@@ -45,6 +45,14 @@ module Pod
@target_integrator.targets.map(&:name).should == %w[ SampleProject ]
end
it 'is robust against build files with missing file references' do
build_file = @sample_project.new(Xcodeproj::Project::PBXBuildFile)
build_file.file_ref = nil
@target_integrator.stubs(:user_project).returns(@sample_project)
@target.frameworks_build_phase.files << build_file
@target_integrator.targets.map(&:name).should == %w[ SampleProject ]
end
it 'does not perform the integration if there are no targets to integrate' do
@target_integrator.stubs(:targets).returns([])
@target_integrator.expects(:add_xcconfig_base_configuration).never
......
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