Skip to content

Commit 1989c59

Browse files
committed
fix not nil Where
1 parent a8a27b4 commit 1989c59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ormlite.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ func Count(db *sql.DB, m Model, opts *Options) (count int64, err error) {
993993
if len(opts.joins) != 0 {
994994
query.WriteString(strings.Join(opts.joins, " "))
995995
}
996-
if opts.Where != nil {
996+
if opts.Where != nil && len(opts.Where) > 0 {
997997
query.WriteString(" where ")
998998
if len(opts.Where) > 1 && opts.Divider == "" {
999999
return 0, errors.New("empty divider with multiple conditions")

0 commit comments

Comments
 (0)