diff --git a/src/client/debugger/Main.ts b/src/client/debugger/Main.ts index e99a1a81e2aa..5cf08b201cf8 100644 --- a/src/client/debugger/Main.ts +++ b/src/client/debugger/Main.ts @@ -188,7 +188,7 @@ export class PythonDebugger extends DebugSession { } else { // When using modules ensure the cwd has been provided - if (typeof args.cwd !== 'string' || args.cwd.length === 0 || this.launchArgs.cwd === 'null') { + if (typeof args.cwd !== 'string' || args.cwd.length === 0 || (this.launchArgs && this.launchArgs.cwd === 'null')) { return this.sendErrorResponse(response, 2001, `'cwd' in 'launch.json' needs to point to the working directory`); } } @@ -674,4 +674,4 @@ export class PythonDebugger extends DebugSession { } } -DebugSession.run(PythonDebugger); \ No newline at end of file +DebugSession.run(PythonDebugger);