From 60b637a26ce26c616e25a2f591d9fd8e4b9eae31 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 4 Oct 2024 09:53:22 -0700 Subject: [PATCH] Fix error with `displayName` is missing in PackageJSON --- .../common/application/commands/reportIssueCommand.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/common/application/commands/reportIssueCommand.ts b/src/client/common/application/commands/reportIssueCommand.ts index 2286bd1e6be2..f2b4f3ffc8c4 100644 --- a/src/client/common/application/commands/reportIssueCommand.ts +++ b/src/client/common/application/commands/reportIssueCommand.ts @@ -104,7 +104,12 @@ export class ReportIssueCommandHandler implements IExtensionSingleActivationServ const installedExtensions = getExtensions() .filter((extension) => !extension.id.startsWith('vscode.')) - .sort((a, b) => a.packageJSON.displayName.localeCompare(b.packageJSON.displayName)) + .sort((a, b) => { + if (a.packageJSON.displayName && b.packageJSON.displayName) { + return a.packageJSON.displayName.localeCompare(b.packageJSON.displayName); + } + return a.id.localeCompare(b.id); + }) .map( (extension) => `|${extension.packageJSON.displayName}|${extension.id}|${extension.packageJSON.version}|`,