diff --git a/server/service/tag.go b/server/service/tag.go index d4a7eeb..5c8ec2f 100644 --- a/server/service/tag.go +++ b/server/service/tag.go @@ -83,6 +83,9 @@ func SetTagInfo(uid uint, id uint, description string, aliasOf *uint, tagType st if !canUpload { return nil, model.NewUnAuthorizedError("User cannot set tag description") } + if aliasOf != nil && *aliasOf == id { + return nil, model.NewRequestError("Tag cannot be an alias of itself") + } if err := dao.SetTagInfo(id, description, aliasOf, tagType); err != nil { return nil, err }