From eb0fb4f68dd4e808223750eff48458c4a131802b Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Thu, 15 Aug 2019 00:43:50 +0100 Subject: [PATCH] fix non existent milestone with 500 error (#7867) --- routers/repo/milestone.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routers/repo/milestone.go b/routers/repo/milestone.go index 3ad638e60af46..5b8a5faa338f5 100644 --- a/routers/repo/milestone.go +++ b/routers/repo/milestone.go @@ -253,6 +253,11 @@ func MilestoneIssuesAndPulls(ctx *context.Context) { milestoneID := ctx.ParamsInt64(":id") milestone, err := models.GetMilestoneByID(milestoneID) if err != nil { + if models.IsErrMilestoneNotExist(err) { + ctx.NotFound("GetMilestoneByID", err) + return + } + ctx.ServerError("GetMilestoneByID", err) return }