Skip to content

Commit eabe828

Browse files
authored
Make sure subsituted string is not null (#1616)
If someone accidentally makes a string setting null, activation can fail Issue: #1609
1 parent 0e74e08 commit eabe828

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/configuration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,8 @@ const configuration = {
487487

488488
const vsCodeVariableRegex = new RegExp(/\$\{(.+?)\}/g);
489489
export function substituteVariablesInString(val: string): string {
490-
return val.replace(vsCodeVariableRegex, (substring: string, varName: string) =>
490+
// Fallback to "" incase someone explicitly sets to null
491+
return (val || "").replace(vsCodeVariableRegex, (substring: string, varName: string) =>
491492
typeof varName === "string" ? computeVscodeVar(varName) || substring : substring
492493
);
493494
}

0 commit comments

Comments
 (0)