From c23cfc0b3613e05885cfaabea1f6a42c2cee5b27 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 3 Nov 2022 16:29:06 -0700 Subject: [PATCH] Add null check to ShouldIgnore --- SabreTools.DatFiles/DatFile.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SabreTools.DatFiles/DatFile.cs b/SabreTools.DatFiles/DatFile.cs index 3be6578d..49360174 100644 --- a/SabreTools.DatFiles/DatFile.cs +++ b/SabreTools.DatFiles/DatFile.cs @@ -546,6 +546,13 @@ namespace SabreTools.DatFiles /// True if the item should be skipped on write, false otherwise protected bool ShouldIgnore(DatItem datItem, bool ignoreBlanks) { + // If this is invoked with a null DatItem, we ignore + if (datItem == null) + { + logger?.Verbose($"Item was skipped because it was null"); + return true; + } + // If the item is supposed to be removed, we ignore if (datItem.Remove) {