From 2a81fe0718eb778ac5782ac4c71d98c756875b03 Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Thu, 9 May 2024 18:06:50 +0100 Subject: [PATCH] nil guard --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 1a0687d..05da3d1 100644 --- a/main.go +++ b/main.go @@ -132,7 +132,11 @@ func (c RejectionCondition) shouldReject(appName, version string, labels []strin func (c *config) matchesRejectionCondition(p *payload) bool { for _, rc := range c.RejectionConditions { - if rc.shouldReject(p.AppName, p.Data["Version"], p.Labels) { + version := "" + if p.Data != nil { + version = p.Data["Version"] + } + if rc.shouldReject(p.AppName, version, p.Labels) { return true } }