From 9e6c6af985a47cf9d644b2d39601cde2a3aec1e8 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 14 Mar 2026 11:24:29 -0400 Subject: [PATCH] Fix missing section case, should never be hit --- SabreTools.Serialization/Wrappers/PortableExecutable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SabreTools.Serialization/Wrappers/PortableExecutable.cs b/SabreTools.Serialization/Wrappers/PortableExecutable.cs index a3472e67..5cb66587 100644 --- a/SabreTools.Serialization/Wrappers/PortableExecutable.cs +++ b/SabreTools.Serialization/Wrappers/PortableExecutable.cs @@ -345,7 +345,7 @@ namespace SabreTools.Serialization.Wrappers // Start from the first section with a valid raw data size and add all section sizes // TODO: Investigate cases where first section pointer does not work var firstSection = Array.Find(SectionTable, s => s.SizeOfRawData != 0); - long endOfSectionData = firstSection.PointerToRawData; + long endOfSectionData = firstSection?.PointerToRawData ?? 0; Array.ForEach(SectionTable, s => endOfSectionData += s.SizeOfRawData); // If we didn't find the end of section data