提交 232d83f3 编写于 作者: M Max Schmitt

Fix of "Cannot read property 'filter' of undefined" in...

Fix of "Cannot read property 'filter' of undefined" in extensionGalleryService. This fixes #38635 and fixes #38357
上级 6c1b3bad
......@@ -202,22 +202,23 @@ function getVersionAsset(version: IRawGalleryExtensionVersion, type: string): IG
const result = version.files.filter(f => f.assetType === type)[0];
if (type === AssetType.Repository) {
const results = version.properties.filter(p => p.key === type);
const gitRegExp = new RegExp('((git|ssh|http(s)?)|(git@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)(/)?');
if (version.properties) {
const results = version.properties.filter(p => p.key === type);
const gitRegExp = new RegExp('((git|ssh|http(s)?)|(git@[\w\.]+))(:(//)?)([\w\.@\:/\-~]+)(\.git)(/)?');
const uri = results.filter(r => gitRegExp.test(r.value))[0];
if (!uri) {
return {
uri: null,
fallbackUri: null
};
}
const uri = results.filter(r => gitRegExp.test(r.value))[0];
if (!uri) {
return {
uri: null,
fallbackUri: null
uri: uri.value,
fallbackUri: uri.value,
};
}
return {
uri: uri.value,
fallbackUri: uri.value,
};
}
if (!result) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册