Avoid NPE

pull/103659/head
Alex Dima 2020-08-03 20:24:31 +02:00
parent a654202e37
commit 34005e2a48
No known key found for this signature in database
GPG Key ID: 6E58D7B045760DA0
2 changed files with 4 additions and 4 deletions

View File

@ -208,8 +208,8 @@ const marketplaceWebExtensions = [
'ms-vscode.references-view'
];
const productJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
const builtInExtensions = productJson.builtInExtensions;
const webBuiltInExtensions = productJson.webBuiltInExtensions;
const builtInExtensions = productJson.builtInExtensions || [];
const webBuiltInExtensions = productJson.webBuiltInExtensions || [];
/**
* Loosely based on `getExtensionKind` from `src/vs/workbench/services/extensions/common/extensionsUtil.ts`
*/

View File

@ -251,8 +251,8 @@ interface IBuiltInExtension {
}
const productJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
const builtInExtensions: IBuiltInExtension[] = productJson.builtInExtensions;
const webBuiltInExtensions: IBuiltInExtension[] = productJson.webBuiltInExtensions;
const builtInExtensions: IBuiltInExtension[] = productJson.builtInExtensions || [];
const webBuiltInExtensions: IBuiltInExtension[] = productJson.webBuiltInExtensions || [];
type ExtensionKind = 'ui' | 'workspace' | 'web';
interface IExtensionManifest {