Skip to content

Commit 44e635f

Browse files
authored
Update expectations_go18.go to accept WillReturnRows(nil)
The addition of the resultset logic caused a nil pointer dereference panic whenever nil is used as an input.
1 parent 44e746a commit 44e635f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

expectations_go18.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func (e *ExpectedQuery) WillReturnRows(rows ...*Rows) *ExpectedQuery {
1616
sets := make([]*Rows, len(rows))
1717
for i, r := range rows {
1818
sets[i] = r
19-
if r.def != nil {
19+
if r != nil && r.def != nil {
2020
defs++
2121
}
2222
}

0 commit comments

Comments
 (0)