diff options
author | zeripath <art27@cantab.net> | 2020-08-04 22:30:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 22:30:02 +0100 |
commit | 33391e04feb6be1c2f8bec0928f500df0f110d89 (patch) | |
tree | 98b88a52e2c0166c6eefb57215fc9fa7bbb473c6 /routers/repo | |
parent | 8a6790b2aa07fa006d0338669e1da6134a58e313 (diff) | |
download | gitea-33391e04feb6be1c2f8bec0928f500df0f110d89.tar.gz gitea-33391e04feb6be1c2f8bec0928f500df0f110d89.zip |
Prevent empty div when editing comment (#12404)
* Prevent empty div when editing comment
The template for attachments needs to remove whitespace and return empty when there are no attachments.
Fix #10220
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/issue.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index b3af6705ca..1f8f484132 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -1975,7 +1975,7 @@ func updateAttachments(item interface{}, files []string) error { case *models.Comment: attachments = content.Attachments default: - return fmt.Errorf("Unknow Type") + return fmt.Errorf("Unknown Type: %T", content) } for i := 0; i < len(attachments); i++ { if util.IsStringInSlice(attachments[i].UUID, files) { @@ -1993,7 +1993,7 @@ func updateAttachments(item interface{}, files []string) error { case *models.Comment: err = content.UpdateAttachments(files) default: - return fmt.Errorf("Unknow Type") + return fmt.Errorf("Unknown Type: %T", content) } if err != nil { return err @@ -2005,7 +2005,7 @@ func updateAttachments(item interface{}, files []string) error { case *models.Comment: content.Attachments, err = models.GetAttachmentsByCommentID(content.ID) default: - return fmt.Errorf("Unknow Type") + return fmt.Errorf("Unknown Type: %T", content) } return err } |