server/service, livequery: Check totals Load for nil (#1802)

Matches status, if there are no results (yet) this bombs as the
the interface value is nil.
This commit is contained in:
Thordur Bjornsson
2018-06-04 09:40:41 -06:00
committed by Mike Arpaia
parent f91790b174
commit 71217e6c52
+5 -1
View File
@@ -43,7 +43,11 @@ func (h *LiveQueryResultsHandler) Results() <-chan kolide.DistributedQueryResult
// Totals returns the current metadata of hosts targeted by the query
func (h *LiveQueryResultsHandler) Totals() *targetTotals {
return h.totals.Load().(*targetTotals)
t := h.totals.Load()
if t != nil {
return t.(*targetTotals)
}
return nil
}
func (h *LiveQueryResultsHandler) Status() *campaignStatus {