From 71217e6c52d8d6814c13cb87c9ba2806bb02df55 Mon Sep 17 00:00:00 2001 From: Thordur Bjornsson Date: Mon, 4 Jun 2018 17:40:41 +0200 Subject: [PATCH] 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. --- server/service/client_live_query.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/service/client_live_query.go b/server/service/client_live_query.go index a295d706c4..694658926d 100644 --- a/server/service/client_live_query.go +++ b/server/service/client_live_query.go @@ -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 {