mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-09-22 06:45:03 +00:00
Disallow empty values in custom dictionaries
This commit is contained in:
@@ -13,7 +13,7 @@ namespace BinaryObjectScanner
|
||||
/// <remarks>Handles the proper Add implementation</remarks>
|
||||
public void Append(T key, string? value)
|
||||
{
|
||||
if (value == null)
|
||||
if (value == null || value.Trim().Length == 0)
|
||||
return;
|
||||
|
||||
#if NET20 || NET35
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user