Skip to content

Commit

Permalink
fix delete comment bug (#4216) (#4228)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and lafriks committed Jun 12, 2018
1 parent 1ff480b commit f106404
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ func (c *Comment) AfterLoad(session *xorm.Session) {

// AfterDelete is invoked from XORM after the object is deleted.
func (c *Comment) AfterDelete() {
if c.ID <= 0 {
return
}

_, err := DeleteAttachmentsByComment(c.ID, true)

if err != nil {
Expand Down

0 comments on commit f106404

Please sign in to comment.