diff options
Diffstat (limited to 'routes')
-rw-r--r-- | routes/api/v1/repo/issue_comment.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/routes/api/v1/repo/issue_comment.go b/routes/api/v1/repo/issue_comment.go index 4a057d76..161ddf05 100644 --- a/routes/api/v1/repo/issue_comment.go +++ b/routes/api/v1/repo/issue_comment.go @@ -15,7 +15,12 @@ import ( func ListIssueComments(c *context.APIContext) { var since time.Time if len(c.Query("since")) > 0 { - since, _ = time.Parse(time.RFC3339, c.Query("since")) + var err error + since, err = time.Parse(time.RFC3339, c.Query("since")) + if err != nil { + c.Error(422, "", err) + return + } } // comments,err:=models.GetCommentsByIssueIDSince(, since) @@ -41,7 +46,12 @@ func ListIssueComments(c *context.APIContext) { func ListRepoIssueComments(c *context.APIContext) { var since time.Time if len(c.Query("since")) > 0 { - since, _ = time.Parse(time.RFC3339, c.Query("since")) + var err error + since, err = time.Parse(time.RFC3339, c.Query("since")) + if err != nil { + c.Error(422, "", err) + return + } } comments, err := models.GetCommentsByRepoIDSince(c.Repo.Repository.ID, since.Unix()) |