]> source.dussan.org Git - gitea.git/commitdiff
fix non existent milestone with 500 error (#7867) (#7873)
authorLanre Adelowo <yo@lanre.wtf>
Thu, 15 Aug 2019 01:37:59 +0000 (02:37 +0100)
committerLunny Xiao <xiaolunwen@gmail.com>
Thu, 15 Aug 2019 01:37:59 +0000 (09:37 +0800)
routers/repo/milestone.go

index 3ad638e60af460bc52a9c348ce48c894fdf4842f..5b8a5faa338f5a5ba741be6fe2b14944798a6d4b 100644 (file)
@@ -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
        }