From 577afc8947da190e01e1e007eda358b01c2a7b51 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 3 Dec 2024 01:02:22 -0500 Subject: [PATCH] Fix issue with PE extensions --- SabreTools.Serialization/Wrappers/PortableExecutable.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SabreTools.Serialization/Wrappers/PortableExecutable.cs b/SabreTools.Serialization/Wrappers/PortableExecutable.cs index 5b49272e..aa4597a8 100644 --- a/SabreTools.Serialization/Wrappers/PortableExecutable.cs +++ b/SabreTools.Serialization/Wrappers/PortableExecutable.cs @@ -1601,7 +1601,7 @@ namespace SabreTools.Serialization.Wrappers _sectionData ??= new byte[SectionNames.Length][]; // If we already have cached data, just use that immediately - if (_sectionData[index].Length > 0) + if (_sectionData[index] != null && _sectionData[index].Length > 0) return _sectionData[index]; // Populate the raw section data based on the source @@ -1687,7 +1687,7 @@ namespace SabreTools.Serialization.Wrappers _sectionStringData ??= new List[SectionNames.Length]; // If we already have cached data, just use that immediately - if (_sectionStringData[index].Count > 0) + if (_sectionStringData[index] != null && _sectionStringData[index].Count > 0) return _sectionStringData[index]; // Populate the section string data based on the source @@ -1799,7 +1799,7 @@ namespace SabreTools.Serialization.Wrappers _tableData ??= new byte[16][]; // If we already have cached data, just use that immediately - if (_tableData[index].Length > 0) + if (_tableData[index] != null && _tableData[index].Length > 0) return _tableData[index]; // Populate the raw table data based on the source @@ -1907,7 +1907,7 @@ namespace SabreTools.Serialization.Wrappers _tableStringData ??= new List[16]; // If we already have cached data, just use that immediately - if (_tableStringData[index].Count > 0) + if (_tableStringData[index] != null && _tableStringData[index].Count > 0) return _tableStringData[index]; // Populate the table string data based on the source