Skip to content

Commit b09510f

Browse files
authored
fix(config): using set with undefined (#5883)
1 parent 27e94e8 commit b09510f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/commands/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ export class ConfigSetCommand implements ICommand {
9191
const convertedValue = this.getConvertedValue(value);
9292
const existingKey = current !== undefined;
9393
const keyDisplay = color.green(key);
94-
const currentDisplay = color.yellow(current);
94+
// when current is undefined, return empty string to avoid throw
95+
const currentDisplay = current ? color.yellow(current) : "";
9596
const updatedDisplay = color.cyan(convertedValue);
9697

9798
this.$logger.info(

0 commit comments

Comments
 (0)