diff --git a/lib/simplecov/source_file.rb b/lib/simplecov/source_file.rb index c68dfd2d..39bb0447 100644 --- a/lib/simplecov/source_file.rb +++ b/lib/simplecov/source_file.rb @@ -268,9 +268,9 @@ def build_branches_report # def build_branches coverage_branch_data = coverage_data.fetch("branches", {}) - branches = coverage_branch_data.flat_map do |condition, coverage_branches| + branches = coverage_branch_data&.flat_map do |condition, coverage_branches| build_branches_from(condition, coverage_branches) - end + end || [] process_skipped_branches(branches) end