From 4d3df4cda6306569c3f2a2b87d51415854b1518a Mon Sep 17 00:00:00 2001 From: qianlifeng Date: Fri, 27 Feb 2015 09:28:07 +0800 Subject: [PATCH] fix #256 --- Wox.Infrastructure/FuzzyMatcher.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Wox.Infrastructure/FuzzyMatcher.cs b/Wox.Infrastructure/FuzzyMatcher.cs index 5b0e144c8d..0da5c89a5e 100644 --- a/Wox.Infrastructure/FuzzyMatcher.cs +++ b/Wox.Infrastructure/FuzzyMatcher.cs @@ -32,6 +32,8 @@ namespace Wox.Infrastructure public MatchResult Evaluate(string str) { + if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(query)) return new MatchResult() { Success = false }; + var len = str.Length; var compareString = opt.IgnoreCase ? str.ToLower() : str; var pattern = opt.IgnoreCase ? query.ToLower() : query;