0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-27 22:59:51 -05:00

fix: check author if lastest is not found (#1994)

This commit is contained in:
Juan Picado 2020-11-22 13:55:14 +01:00 committed by GitHub
parent 64f6cbd449
commit 185babc53f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,7 +125,13 @@ function addPackageWebApi(route: Router, storage: IStorageHandler, auth: IAuth,
sideBarInfo.latest.author = formatAuthor(sideBarInfo.latest.author);
} else {
sideBarInfo.latest = sideBarInfo.versions[info[DIST_TAGS].latest];
sideBarInfo.latest.author = formatAuthor(sideBarInfo.latest.author);
if (sideBarInfo?.latest) {
sideBarInfo.latest.author = formatAuthor(sideBarInfo.latest.author);
} else {
res.status(HTTP_STATUS.NOT_FOUND);
res.end();
return;
}
}
sideBarInfo = deleteProperties(['readme', '_attachments', '_rev', 'name'], sideBarInfo);
if (config.web) {