Skip to content

Commit 45c4139

Browse files
authored
Fix maven panic when no package exists (#33888)
Fix #33886 Restore the old logic from #16510, which was incorrectly removed by #33678
1 parent 0dfa94e commit 45c4139

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

routers/api/packages/maven/maven.go

+5
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ func serveMavenMetadata(ctx *context.Context, params parameters) {
9898
}
9999
pvs = append(pvsLegacy, pvs...)
100100

101+
if len(pvs) == 0 {
102+
apiError(ctx, http.StatusNotFound, packages_model.ErrPackageNotExist)
103+
return
104+
}
105+
101106
pds, err := packages_model.GetPackageDescriptors(ctx, pvs)
102107
if err != nil {
103108
apiError(ctx, http.StatusInternalServerError, err)

0 commit comments

Comments
 (0)