Skip to content

Commit f5e7d95

Browse files
13791379
authored andcommitted
fix: Fix the problem of incorrect judgment error when uploading files
1 parent dd42149 commit f5e7d95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service/impl/attachment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (a *attachmentServiceImpl) Upload(ctx context.Context, fileHeader *multipar
147147
WithStatus(xerr.StatusBadRequest).
148148
WithMsg("附件路径为 " + attachmentDTO.Path + " 已经存在")
149149
}
150-
if err != nil && errors.Is(err, gorm.ErrRecordNotFound) {
150+
if !errors.Is(err, gorm.ErrRecordNotFound) {
151151
return nil, WrapDBErr(err)
152152
}
153153
attachmentEntity := &entity.Attachment{

0 commit comments

Comments
 (0)