Skip to content

Commit

Permalink
Merge 9e73270 into 6fa3d4c
Browse files Browse the repository at this point in the history
  • Loading branch information
chillpop committed Apr 23, 2021
2 parents 6fa3d4c + 9e73270 commit 700c4c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ def pathnames_per_binary(binary_path)
coverage_json = JSON.parse(coverage_json_string)
coverage_json["data"].reduce([]) do |result, chunk|
result.concat(chunk["files"].map do |file|
{"filename" => Pathname(file["filename"]).realpath, "segments" => file["segments"]}
filename = file["filename"]
path = Pathname(filename)
# Don't crash if the file doesn't exist on disk.
# This may happen for autogenerated files that have been deleted.
filename = path.exist? ? path.realpath : filename
{"filename" => filename, "segments" => file["segments"]}
end)
end
end
Expand Down

0 comments on commit 700c4c8

Please sign in to comment.