Gracefully handle empty iterator close

Prevent nil panic.
This commit is contained in:
Tomaž Jerman
2022-06-14 12:06:13 +02:00
parent d7480c8daf
commit 7bac115ceb
+3
View File
@@ -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()
}