Skip to content

Commit d7fc141

Browse files
committed
Add another base case for FindCommonPrefix for when names.Count is 0
This commit fixes the allowLeadingDigits overload. The previous similarly named commit fixes the maxLen overload.
1 parent f9d72f3 commit d7fc141

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sources/SilkTouch/SilkTouch/Naming/NameUtils.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ public static string FindCommonPrefix(
8686
bool naive = false
8787
)
8888
{
89+
if (names.Count == 0)
90+
{
91+
return "";
92+
}
93+
8994
if (allowFullMatch && names.Count == 1)
9095
{
9196
return names.First();

0 commit comments

Comments
 (0)