提交 66c2d695 编写于 作者: I isidor

fixes #19353

上级 211d9ccd
......@@ -55,7 +55,9 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem {
manager.openConfigFile(false).then(editor => {
if (editor) {
const codeEditor = <ICommonCodeEditor>editor.getControl();
return codeEditor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).addLaunchConfiguration();
if (codeEditor) {
return codeEditor.getContribution<IDebugEditorContribution>(EDITOR_CONTRIBUTION_ID).addLaunchConfiguration();
}
}
});
} else {
......
......@@ -393,7 +393,8 @@ export class ConfigurationManager implements debug.IConfigurationManager {
const editor = this.editorService.getActiveEditor();
if (editor) {
const model = (<ICommonCodeEditor>editor.getControl()).getModel();
const codeEditor = <ICommonCodeEditor>editor.getControl();
const model = codeEditor ? codeEditor.getModel() : undefined;
const language = model ? model.getLanguageIdentifier().language : undefined;
const adapter = this.adapters.filter(a => a.languages && a.languages.indexOf(language) >= 0).pop();
if (adapter) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册