1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-23 19:20:53 +00:00

Merge pull request #4301 from flycash/fix4298

Fix 4298
This commit is contained in:
Ming Deng 2020-11-11 08:55:08 +08:00 committed by GitHub
commit c5c03815f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,10 +76,13 @@ func (c Condition) AndNot(expr string, args ...interface{}) *Condition {
// AndCond combine a condition to current condition // AndCond combine a condition to current condition
func (c *Condition) AndCond(cond *Condition) *Condition { func (c *Condition) AndCond(cond *Condition) *Condition {
c = c.clone()
if c == cond { if c == cond {
panic(fmt.Errorf("<Condition.AndCond> cannot use self as sub cond")) panic(fmt.Errorf("<Condition.AndCond> cannot use self as sub cond"))
} }
c = c.clone()
if cond != nil { if cond != nil {
c.params = append(c.params, condValue{cond: cond, isCond: true}) c.params = append(c.params, condValue{cond: cond, isCond: true})
} }