From 7154c3c932f11f269ae606d74666657a05e46339 Mon Sep 17 00:00:00 2001 From: Thomas Mota Date: Wed, 2 Mar 2022 09:35:24 +0100 Subject: [PATCH] fix: add null check to exemplar data Signed-off-by: Thomas Mota --- pkg/exemplars/exemplars.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/exemplars/exemplars.go b/pkg/exemplars/exemplars.go index 36b0ce9ffb..2817d15555 100644 --- a/pkg/exemplars/exemplars.go +++ b/pkg/exemplars/exemplars.go @@ -89,6 +89,10 @@ func (rr *GRPCClient) Exemplars(ctx context.Context, req *exemplarspb.ExemplarsR return nil, nil, errors.Wrap(err, "proxy Exemplars") } + if resp.data == nil { + return make([]*exemplarspb.ExemplarData, 0), resp.warnings, nil + } + resp.data = dedupExemplarsResponse(resp.data, rr.replicaLabels) return resp.data, resp.warnings, nil }