From 15ac8564c10635887aa013e867027dedb46f176f Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 31 Oct 2018 16:38:28 +0100 Subject: [PATCH] fixes #62202 --- src/vs/workbench/parts/debug/browser/debugEditorActions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts b/src/vs/workbench/parts/debug/browser/debugEditorActions.ts index 4c2cda36b29..98e4459bf0b 100644 --- a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugEditorActions.ts @@ -113,12 +113,14 @@ class RunToCursorAction extends EditorAction { public run(accessor: ServicesAccessor, editor: ICodeEditor): TPromise { const debugService = accessor.get(IDebugService); - if (debugService.state !== State.Stopped) { + const focusedSession = debugService.getViewModel().focusedSession; + if (debugService.state !== State.Stopped || !focusedSession) { return Promise.resolve(null); } let breakpointToRemove: IBreakpoint; - const oneTimeListener = debugService.onDidChangeState(state => { + const oneTimeListener = focusedSession.onDidChangeState(() => { + const state = focusedSession.state; if (state === State.Stopped || state === State.Inactive) { if (breakpointToRemove) { debugService.removeBreakpoints(breakpointToRemove.getId()); -- GitLab