From a572979168c36ab030bfeea45fc63c69bc999378 Mon Sep 17 00:00:00 2001 From: GROpenSourceDev Date: Mon, 5 Sep 2016 13:55:31 +0000 Subject: [PATCH] Collect: Add null check on error --- collect/queue.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/collect/queue.go b/collect/queue.go index 34e9dcbd8b..a7b5f8e1db 100644 --- a/collect/queue.go +++ b/collect/queue.go @@ -175,6 +175,10 @@ func SendDataPoints(dps []*opentsdb.DataPoint, tsdb string) (*http.Response, err if UseNtlm { resp, err := ntlm.DoNTLMRequest(DefaultClient, req) + if err != nil { + return nil, err + } + if resp.StatusCode == 401 { slog.Errorf("Scollector unauthorized to post data points to tsdb. Terminating.") os.Exit(1)