You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a launch configuration located in the VS Code workspace file (instead of the usual <folder>/.vscode/launch.json) does not specify cwd, attempting to launch a debug session will fail with a Cannot read property 'uri' of undefined error popup.
The bug seems to be located in resolveDebugConfigurationWithSubstitutedVariables:
Note how the uri member is accessed without validity checks, despite it being vscode.WorkspaceFolder | undefined (folder?.uri.fsPath should probably have been used instead).
To Reproduce
Steps to reproduce the behavior:
Create a VS Code Workspace
Add a launch section in the .code-workspace file
Create a cortex-debug launch configuration
Making sure that cwd is not present in the launch configuration, attempt launch
See issue: Cannot read property 'uri' of undefined
Add cwd to launch configuration, attempt launch
See that the debug session starts properly
Expected behavior
If cwd is not provided, rather than crashing, the extension should display an error message, as is done a few lines below the buggy code mentioned earlier.
Describe the bug
If a launch configuration located in the VS Code workspace file (instead of the usual
<folder>/.vscode/launch.json
) does not specifycwd
, attempting to launch a debug session will fail with aCannot read property 'uri' of undefined
error popup.The bug seems to be located in
resolveDebugConfigurationWithSubstitutedVariables
:cortex-debug/src/frontend/configprovider.ts
Lines 202 to 206 in 8210ae4
The buggy statement appears to be the very first of the function:
cortex-debug/src/frontend/configprovider.ts
Line 207 in 8210ae4
Note how the
uri
member is accessed without validity checks, despite it beingvscode.WorkspaceFolder | undefined
(folder?.uri.fsPath
should probably have been used instead).To Reproduce
Steps to reproduce the behavior:
launch
section in the.code-workspace
filecortex-debug
launch configurationcwd
is not present in the launch configuration, attempt launchCannot read property 'uri' of undefined
cwd
to launch configuration, attempt launchExpected behavior
If
cwd
is not provided, rather than crashing, the extension should display an error message, as is done a few lines below the buggy code mentioned earlier.cortex-debug/src/frontend/configprovider.ts
Lines 211 to 214 in 8210ae4
Screenshots
N/A
Environment:
Additional context
N/A
The text was updated successfully, but these errors were encountered: