summaryrefslogtreecommitdiffstats
path: root/models/issue_comment.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r--models/issue_comment.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index a829c80663..1c7c57dd06 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -147,6 +147,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 {