mirror of
https://github.com/DATA-DOG/go-sqlmock.git
synced 2025-03-17 20:48:01 +02:00
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.
This commit is contained in:
parent
44e746a20e
commit
44e635fc27
@ -16,7 +16,7 @@ func (e *ExpectedQuery) WillReturnRows(rows ...*Rows) *ExpectedQuery {
|
||||
sets := make([]*Rows, len(rows))
|
||||
for i, r := range rows {
|
||||
sets[i] = r
|
||||
if r.def != nil {
|
||||
if r != nil && r.def != nil {
|
||||
defs++
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user