From 75490b7e13d4f7e4a579cdf5d8c86214eab87dbf Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 19 Jul 2020 13:09:08 -0700 Subject: [PATCH] Try different approach to null items --- SabreTools.Library/DatFiles/DatFile.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index a89e589f..05ac99e5 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -63,7 +63,7 @@ namespace SabreTools.Library.DatFiles EnsureKey(key); // Now return the value - return Items[key].Where(i => i != null).ToList(); + return Items[key]; } } @@ -77,6 +77,10 @@ namespace SabreTools.Library.DatFiles // Ensure the key exists EnsureKey(key); + // If item is null, don't add it + if (value == null) + return; + // Now add the value Items[key].Add(value);