diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2018-06-12 06:54:30 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-06-11 18:54:30 -0400 |
commit | da898d4066e4d2a0f10ba668faf43879fd927dd2 (patch) | |
tree | 76c85a2e97b54447de5c10492e68e9822c5ad01f /models/issue_comment.go | |
parent | 508092a24859732f1669610051a627c12f713234 (diff) | |
download | gitea-da898d4066e4d2a0f10ba668faf43879fd927dd2.tar.gz gitea-da898d4066e4d2a0f10ba668faf43879fd927dd2.zip |
fix delete comment bug (#4216)
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r-- | models/issue_comment.go | 4 |
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 { |