Skip to content

Commit

Permalink
Fixed accessing undefined when no arguments are returned
Browse files Browse the repository at this point in the history
  • Loading branch information
gb999 committed Aug 19, 2024
1 parent f06f97c commit f9c9e5f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export function activate(context: vscode.ExtensionContext) {
}

if (pss.length === 1) {
vscode.window.showInformationMessage(`Matched process with pid '${pss[0].pid}'. Command: '${pss[0].command} ${pss[0].arguments.join(' ')}'`);
const args = pss[0].arguments ? pss[0].arguments.join(' ') : '';
vscode.window.showInformationMessage(`Matched process with pid '${pss[0].pid}'. Command: '${pss[0].command} ${args}'`);
return pss[0].pid;
}

Expand Down

0 comments on commit f9c9e5f

Please sign in to comment.