diff options
author | 6543 <6543@obermui.de> | 2020-02-28 00:10:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-27 20:10:27 -0300 |
commit | e57ac841de1fc93df15ba8bef280077bbb733bf1 (patch) | |
tree | d81462a68ee6ae6276ae14ef0b3ccc7c0d77ada7 /models/attachment.go | |
parent | 15fbf509d3475cef3f8a7e994b59e4d78fd1c508 (diff) | |
download | gitea-e57ac841de1fc93df15ba8bef280077bbb733bf1.tar.gz gitea-e57ac841de1fc93df15ba8bef280077bbb733bf1.zip |
Fix potential bugs (#10513)
* use e if it is an option
* potential nil so check err first
* check err first
* m == nil already checked
Diffstat (limited to 'models/attachment.go')
-rw-r--r-- | models/attachment.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/models/attachment.go b/models/attachment.go index 81f2e15dad..7e59c7eef4 100644 --- a/models/attachment.go +++ b/models/attachment.go @@ -199,7 +199,7 @@ func GetAttachmentsByCommentID(commentID int64) ([]*Attachment, error) { func getAttachmentsByCommentID(e Engine, commentID int64) ([]*Attachment, error) { attachments := make([]*Attachment, 0, 10) - return attachments, x.Where("comment_id=?", commentID).Find(&attachments) + return attachments, e.Where("comment_id=?", commentID).Find(&attachments) } // getAttachmentByReleaseIDFileName return a file based on the the following infos: |