diff --git a/BinaryObjectScanner/CheckDictionary.cs b/BinaryObjectScanner/CheckDictionary.cs index 1093172b..84d1146d 100644 --- a/BinaryObjectScanner/CheckDictionary.cs +++ b/BinaryObjectScanner/CheckDictionary.cs @@ -13,7 +13,7 @@ namespace BinaryObjectScanner /// Handles the proper Add implementation public void Append(T key, string? value) { - if (value == null) + if (value == null || value.Trim().Length == 0) return; #if NET20 || NET35 diff --git a/BinaryObjectScanner/ProtectionDictionary.cs b/BinaryObjectScanner/ProtectionDictionary.cs index 00761575..d5b16ad2 100644 --- a/BinaryObjectScanner/ProtectionDictionary.cs +++ b/BinaryObjectScanner/ProtectionDictionary.cs @@ -24,7 +24,7 @@ namespace BinaryObjectScanner public void Append(string key, string value) { // If the value is empty, don't add it - if (string.IsNullOrEmpty(value)) + if (value == null || value.Trim().Length == 0) return; Append(key, [value]); @@ -44,6 +44,9 @@ namespace BinaryObjectScanner EnsureKey(key); foreach (string value in values) { + if (value == null || value.Trim().Length == 0) + continue; + this[key].Enqueue(value); } } @@ -180,6 +183,9 @@ namespace BinaryObjectScanner foreach (string value in values) { + if (value == null || value.Trim().Length == 0) + continue; + this[key].Enqueue(value); } }