Add null check to ShouldIgnore

This commit is contained in:
Matt Nadareski
2022-11-03 16:29:06 -07:00
parent b3b2176b01
commit c23cfc0b36

View File

@@ -546,6 +546,13 @@ namespace SabreTools.DatFiles
/// <returns>True if the item should be skipped on write, false otherwise</returns>
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)
{