mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 09:25:46 +03:00
Verify iter to avoid panic
This commit is contained in:
@@ -149,10 +149,12 @@ func toArray(iter memdb.ResultIterator, err error) []interface{} {
|
||||
|
||||
r := []interface{}{}
|
||||
|
||||
item := iter.Next()
|
||||
for item != nil {
|
||||
r = append(r, item)
|
||||
item = iter.Next()
|
||||
if iter != nil {
|
||||
item := iter.Next()
|
||||
for item != nil {
|
||||
r = append(r, item)
|
||||
item = iter.Next()
|
||||
}
|
||||
}
|
||||
|
||||
return r
|
||||
|
||||
Reference in New Issue
Block a user