From 21357a4ae04068a7ebe5ee5bc800ef36e11fd614 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Thu, 27 Dec 2018 16:02:43 +0100 Subject: [PATCH] fix nil pointer when adding a due date (#5587) * fix nil pointer * remove nil check and just call loadRepo regardless --- models/issue_comment.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/issue_comment.go b/models/issue_comment.go index 577de1d84..651cbdfad 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -708,6 +708,10 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin content = newDeadlineUnix.Format("2006-01-02") + "|" + issue.DeadlineUnix.Format("2006-01-02") } + if err := issue.LoadRepo(); err != nil { + return nil, err + } + return createComment(e, &CreateCommentOptions{ Type: commentType, Doer: doer,