Skip to content

Commit

Permalink
Fix check for using default values
Browse files Browse the repository at this point in the history
- The check used for seeing if default values or not was working improperly as it was checking the boolean-ness of a variable.
  - So, if the value provided was false it would still use a default value.
  - To fix the issue we need to check if accessing the varaible returns undefined meaning it wasn't provided so use the default then.

Closes apache#852
  • Loading branch information
shanedell committed Nov 29, 2023
1 parent f2d880a commit 76c7b06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ export function getConfig(jsonArgs: object): vscode.DebugConfiguration {

Object.entries(defaultValues).map(
([key, defaultValue]) =>
(launchConfigArgs[key] = launchConfigArgs[key]
? launchConfigArgs[key]
: defaultValue)
(launchConfigArgs[key] =
launchConfigArgs[key] !== undefined
? launchConfigArgs[key]
: defaultValue)
)

return JSON.parse(JSON.stringify(launchConfigArgs))
Expand Down

0 comments on commit 76c7b06

Please sign in to comment.