File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export class LocalDebugClient extends DebugClient {
6666 }
6767 public LaunchApplicationToDebug ( dbgServer : IDebugServer , processErrored : ( error : any ) => void ) : Promise < any > {
6868 return new Promise < any > ( ( resolve , reject ) => {
69- let fileDir = path . dirname ( this . args . program ) ;
69+ let fileDir = this . args && this . args . program ? path . dirname ( this . args . program ) : '' ;
7070 let processCwd = fileDir ;
7171 if ( typeof this . args . cwd === 'string' && this . args . cwd . length > 0 && this . args . cwd !== 'null' ) {
7272 processCwd = this . args . cwd ;
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ export class PythonDebugger extends DebugSession {
8181 private debugServer : BaseDebugServer ;
8282
8383 private startDebugServer ( ) : Promise < IDebugServer > {
84- let programDirectory = this . launchArgs ? path . dirname ( this . launchArgs . program ) : this . attachArgs . localRoot ;
84+ let programDirectory = '' ;
85+ if ( ( this . launchArgs && this . launchArgs . program ) || ( this . attachArgs && this . attachArgs . localRoot ) ) {
86+ programDirectory = this . launchArgs ? path . dirname ( this . launchArgs . program ) : this . attachArgs . localRoot ;
87+ }
8588 if ( this . launchArgs && typeof this . launchArgs . cwd === 'string' && this . launchArgs . cwd . length > 0 && this . launchArgs . cwd !== 'null' ) {
8689 programDirectory = this . launchArgs . cwd ;
8790 }
You can’t perform that action at this time.
0 commit comments