forked from mirror/gorm
Don't use invalid value to build conditions, close #3912
This commit is contained in:
parent
60b769c2c8
commit
00a785cd68
|
@ -308,7 +308,7 @@ func (stmt *Statement) BuildCondition(query interface{}, args ...interface{}) []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
reflectValue := reflect.Indirect(reflect.ValueOf(arg))
|
if reflectValue := reflect.Indirect(reflect.ValueOf(arg)); reflectValue.IsValid() {
|
||||||
if s, err := schema.Parse(arg, stmt.DB.cacheStore, stmt.DB.NamingStrategy); err == nil {
|
if s, err := schema.Parse(arg, stmt.DB.cacheStore, stmt.DB.NamingStrategy); err == nil {
|
||||||
selectedColumns := map[string]bool{}
|
selectedColumns := map[string]bool{}
|
||||||
if idx == 0 {
|
if idx == 0 {
|
||||||
|
@ -374,6 +374,7 @@ func (stmt *Statement) BuildCondition(query interface{}, args ...interface{}) []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return conds
|
return conds
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue