Fix panic with raw SQL

This commit is contained in:
Jinzhu 2018-02-28 07:43:56 +08:00
parent a12c2a2e13
commit 6ed508ec6a
1 changed files with 1 additions and 1 deletions

View File

@ -650,7 +650,7 @@ func (scope *Scope) buildCondition(clause map[string]interface{}, include bool)
buff := bytes.NewBuffer([]byte{})
i := 0
for _, s := range str {
if s == '?' {
if s == '?' && len(replacements) > i {
buff.WriteString(replacements[i])
i++
} else {