Fix maven panic when no package exists ()

Fix 

Restore the old logic from , which was incorrectly removed by
pull/33863/head^2
wxiaoguang 2025-03-15 01:35:40 +08:00 committed by GitHub
parent 0dfa94edc8
commit 45c4139134
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions
routers/api/packages/maven

View File

@ -98,6 +98,11 @@ func serveMavenMetadata(ctx *context.Context, params parameters) {
}
pvs = append(pvsLegacy, pvs...)
if len(pvs) == 0 {
apiError(ctx, http.StatusNotFound, packages_model.ErrPackageNotExist)
return
}
pds, err := packages_model.GetPackageDescriptors(ctx, pvs)
if err != nil {
apiError(ctx, http.StatusInternalServerError, err)