From 91eeff1f0f87df37b85ab6314b60e178746e83e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TATSUNO=20=E2=80=9CTaz=E2=80=9D=20Yasuhiro?= Date: Wed, 3 Sep 2025 13:20:57 +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 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