diff --git a/lib/commands/config.ts b/lib/commands/config.ts index 83f4c8369c..8689880fcd 100644 --- a/lib/commands/config.ts +++ b/lib/commands/config.ts @@ -91,7 +91,8 @@ export class ConfigSetCommand implements ICommand { const convertedValue = this.getConvertedValue(value); const existingKey = current !== undefined; const keyDisplay = color.green(key); - const currentDisplay = color.yellow(current); + // when current is undefined, return empty string to avoid throw + const currentDisplay = current ? color.yellow(current) : ""; const updatedDisplay = color.cyan(convertedValue); this.$logger.info(