diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 8528759d14..2b5a149d16 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -119,17 +119,17 @@ export const DebuggerApiMixin = (Base) => class extends Base { debug (hash) { this.debugHash = hash - this.onDebugRequestedListener(hash) + if (this.onDebugRequestedListener) this.onDebugRequestedListener(hash) } onActivation () { - this.on('editor', 'breakpointCleared', (fileName, row) => this.onBreakpointClearedListener(fileName, row)) - this.on('editor', 'breakpointAdded', (fileName, row) => this.onBreakpointAddedListener(fileName, row)) - this.on('editor', 'contentChanged', () => this.onEditorContentChangedListener()) + this.on('editor', 'breakpointCleared', (fileName, row) => { if (this.onBreakpointClearedListener) this.onBreakpointClearedListener(fileName, row) }) + this.on('editor', 'breakpointAdded', (fileName, row) => { if (this.onBreakpointAddedListener) this.onBreakpointAddedListener(fileName, row) }) + this.on('editor', 'contentChanged', () => { if (this.onEditorContentChangedListener) this.onEditorContentChangedListener() }) } onDeactivation () { - this.onRemoveHighlightsListener() + if (this.onRemoveHighlightsListener) this.onRemoveHighlightsListener() this.off('editor', 'breakpointCleared') this.off('editor', 'breakpointAdded') this.off('editor', 'contentChanged')