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:
parent
64f6cbd449
commit
185babc53f
1 changed files with 7 additions and 1 deletions
|
@ -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];
|
||||
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue