From cf56248d146c5f80218e3447384855985d3cc25e Mon Sep 17 00:00:00 2001 From: Ashkan Parsa Date: Wed, 9 Feb 2022 14:08:14 -0800 Subject: [PATCH] Bug fix part needs to be check for any character before selecting index 0 --- SymSpell/SymSpell.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SymSpell/SymSpell.cs b/SymSpell/SymSpell.cs index 6014781..c640ea1 100644 --- a/SymSpell/SymSpell.cs +++ b/SymSpell/SymSpell.cs @@ -1124,7 +1124,7 @@ public List LookupCompound(string input, int editDistanceMax) topResult = results[0].term; //v6.7 //retain/preserve upper case - if (Char.IsUpper(part[0])) + if (part.Any() && Char.IsUpper(part[0])) { char[] a = topResult.ToCharArray(); a[0] = char.ToUpper(topResult[0]);