Skip to content

Commit

Permalink
Fix panic with raw SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Feb 27, 2018
1 parent a12c2a2 commit 6ed508e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6ed508e

Please sign in to comment.