Skip to content

Commit

Permalink
Merge pull request jmoiron#268 from classmarkets/scan-any-panic
Browse files Browse the repository at this point in the history
scanAny: add nil check
  • Loading branch information
jmoiron authored Dec 9, 2016
2 parents f9b4c7a + 590692e commit cac998c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,10 @@ func (r *Row) scanAny(dest interface{}, structOnly bool) error {
if r.err != nil {
return r.err
}
if r.rows == nil {
r.err = sql.ErrNoRows
return r.err
}
defer r.rows.Close()

v := reflect.ValueOf(dest)
Expand Down

0 comments on commit cac998c

Please sign in to comment.