Skip to content

Commit 3121d04

Browse files
authored
Merge pull request microsoft#101017 from Titozzz/patch-1
fix(search): Replace crash empty string pattern
2 parents 040e325 + fc9b86d commit 3121d04

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/vs/base/common/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function buildReplaceStringWithCasePreserved(matches: string[] | null, pa
1818
return pattern.toUpperCase();
1919
} else if (matches[0].toLowerCase() === matches[0]) {
2020
return pattern.toLowerCase();
21-
} else if (strings.containsUppercaseCharacter(matches[0][0])) {
21+
} else if (strings.containsUppercaseCharacter(matches[0][0]) && pattern.length > 0) {
2222
return pattern[0].toUpperCase() + pattern.substr(1);
2323
} else {
2424
// we don't understand its pattern yet.

0 commit comments

Comments
 (0)