From 312e8a778c9eac3fcb1fa9c2847e558935c7f8e3 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 21 May 2019 12:52:34 -0700 Subject: [PATCH] Handle cases using "of-as-game" where those values are null (Fixes #12) --- SabreTools.Library/DatFiles/FilterItem.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SabreTools.Library/DatFiles/FilterItem.cs b/SabreTools.Library/DatFiles/FilterItem.cs index 90f7f4cf..6b6b7968 100644 --- a/SabreTools.Library/DatFiles/FilterItem.cs +++ b/SabreTools.Library/DatFiles/FilterItem.cs @@ -155,15 +155,13 @@ namespace SabreTools.Library.DatFiles { string needleString = needle as string; string strawString = straw as string; - if (!String.IsNullOrWhiteSpace(strawString)) + if (!String.IsNullOrWhiteSpace(strawString) && needleString != null) { string regexStraw = strawString; // If the straw has no special characters at all, treat it as an exact match if (regexStraw == Regex.Escape(regexStraw)) - { regexStraw = "^" + regexStraw + "$"; - } // Check if a match is found with the regex found |= Regex.IsMatch(needleString, regexStraw, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);