1
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-03-22 14:50:13 +03:00

Fix maven panic when no package exists (#33888)

Fix #33886

Restore the old logic from #16510, which was incorrectly removed by
#33678
This commit is contained in:
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

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)