summaryrefslogtreecommitdiffstats
path: root/models/issue_reaction.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue_reaction.go')
-rw-r--r--models/issue_reaction.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/models/issue_reaction.go b/models/issue_reaction.go
index 104afce5c1..ad85e5747c 100644
--- a/models/issue_reaction.go
+++ b/models/issue_reaction.go
@@ -178,11 +178,15 @@ func CreateCommentReaction(doer *User, issue *Issue, comment *Comment, content s
})
}
-func deleteReaction(e *xorm.Session, opts *ReactionOptions) error {
+func deleteReaction(e Engine, opts *ReactionOptions) error {
reaction := &Reaction{
- Type: opts.Type,
- UserID: opts.Doer.ID,
- IssueID: opts.Issue.ID,
+ Type: opts.Type,
+ }
+ if opts.Doer != nil {
+ reaction.UserID = opts.Doer.ID
+ }
+ if opts.Issue != nil {
+ reaction.IssueID = opts.Issue.ID
}
if opts.Comment != nil {
reaction.CommentID = opts.Comment.ID