Fix append of possible nil iterator.

This commit updates an iterator list to ignore `nil` iterators.
Adding a `nil` caused the `SeriesIterators.Close()` to panic.
pull/10326/head
Ben Johnson 2018-10-02 13:17:54 -06:00
parent c6889b1a95
commit bdcbad3fc9
No known key found for this signature in database
GPG Key ID: 81741CD251883081
1 changed files with 3 additions and 1 deletions

View File

@ -343,7 +343,9 @@ func (f *LogFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator
if tv.cardinality() == 0 {
continue
}
itrs = append(itrs, tsdb.NewSeriesIDSetIterator(tv.seriesIDSet()))
if itr := tsdb.NewSeriesIDSetIterator(tv.seriesIDSet()); itr != nil {
itrs = append(itrs, itr)
}
}
return tsdb.MergeSeriesIDIterators(itrs...)