Gracefully handle empty iterator close
Prevent nil panic.
This commit is contained in:
@@ -209,6 +209,9 @@ func (i *iterator) Err() error {
|
||||
|
||||
// Close iterator and cleanup
|
||||
func (i *iterator) Close() error {
|
||||
if i.rows == nil {
|
||||
return nil
|
||||
}
|
||||
return i.rows.Close()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user