From 4ad72dec57f9e24a03b867c82d3eca0d951f55db Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Fri, 25 May 2018 15:57:32 +0200 Subject: [PATCH] Check if reviewer is nil Signed-off-by: Jonas Franz --- models/review.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/review.go b/models/review.go index c02f7a5ba9..5a4e0be244 100644 --- a/models/review.go +++ b/models/review.go @@ -177,6 +177,9 @@ func CreateReview(opts CreateReviewOptions) (*Review, error) { } func getCurrentReview(e Engine, reviewer *User, issue *Issue) (*Review, error) { + if reviewer == nil { + return nil, nil + } reviews, err := findReviews(e, FindReviewOptions{ Type: ReviewTypePending, IssueID: issue.ID,