vscode-perl-debug icon indicating copy to clipboard operation
vscode-perl-debug copied to clipboard

Exception when launching without editor and without launch.json

Open hoehrmann opened this issue 5 years ago • 0 comments

This should help:

diff --git a/src/extension.ts b/src/extension.ts
index 83ab723..bb1c08c 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -184,7 +184,15 @@ class PerlDebugConfigurationProvider implements vscode.DebugConfigurationProvide
 
                const editor = vscode.window.activeTextEditor;
 
-               if (!config.request && editor.document.languageId === 'perl') {
+               const perlEditor = (
+                       editor
+                       &&
+                       editor.document
+                       &&
+                       editor.document.languageId === 'perl'
+               );
+
+               if (!config.request && perlEditor) {
 
                        const defaultConfig = vscode.extensions.getExtension(
                                "mortenhenriksen.perl-debug"

hoehrmann avatar Mar 11 '19 23:03 hoehrmann