Explorar el Código

nullish and undefined editor finder instance prevent

krzysztof.sikora hace 4 años
padre
commit
903cb46594
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      src/service.ts

+ 5 - 3
src/service.ts

@@ -163,7 +163,7 @@ export class DebuggerService implements IDebugger, IDisposable {
    * @param code The source code.
    */
   getCodeId(code: string): string {
-    return this._editorFinder.getCodeId(code);
+    return this._editorFinder.getCodeId(code) ?? '';
   }
 
   /**
@@ -225,8 +225,10 @@ export class DebuggerService implements IDebugger, IDisposable {
     const breakpoints = this._mapBreakpoints(reply.body.breakpoints);
     const stoppedThreads = new Set(reply.body.stoppedThreads);
 
-    this._editorFinder.setHashParameters(hashMethod, hashSeed);
-    this._editorFinder.setTmpFileParameters(tmpFilePrefix, tmpFileSuffix);
+    if (this._editorFinder) {
+      this._editorFinder.setHashParameters(hashMethod, hashSeed);
+      this._editorFinder.setTmpFileParameters(tmpFilePrefix, tmpFileSuffix);
+    }
 
     this._model.stoppedThreads = stoppedThreads;