From 99c9ee015f4999f3444ef364159c2fca9ff5c116 Mon Sep 17 00:00:00 2001 From: exoego Date: Fri, 3 Nov 2023 09:06:38 +0900 Subject: [PATCH] Fallback to empty array if branches is missing --- lib/simplecov/source_file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/simplecov/source_file.rb b/lib/simplecov/source_file.rb index 3d9efcd6..c12711e9 100644 --- a/lib/simplecov/source_file.rb +++ b/lib/simplecov/source_file.rb @@ -272,9 +272,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