From e788ad92870b52bc80523227910bd623832e9222 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 3 Dec 2024 03:54:55 -0500 Subject: [PATCH] Ensure keys in a better way --- BinaryObjectScanner/ProtectionDictionary.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/BinaryObjectScanner/ProtectionDictionary.cs b/BinaryObjectScanner/ProtectionDictionary.cs index c365fa72..69f21777 100644 --- a/BinaryObjectScanner/ProtectionDictionary.cs +++ b/BinaryObjectScanner/ProtectionDictionary.cs @@ -27,6 +27,7 @@ namespace BinaryObjectScanner if (value == null || value.Trim().Length == 0) return; + EnsureKey(key); foreach (string subValue in ProcessProtectionString(value)) { this[key].Enqueue(subValue); @@ -40,9 +41,6 @@ namespace BinaryObjectScanner /// String value array to add public void Append(string key, string[] values) { - // Use a placeholder value if the key is null - key ??= "NO FILENAME"; - // Add the key if needed and then append the lists EnsureKey(key); foreach (string value in values) @@ -187,6 +185,7 @@ namespace BinaryObjectScanner if (values == null) return; + EnsureKey(key); foreach (string value in values) { if (value == null || value.Trim().Length == 0)