Skip to content

Commit

Permalink
nil guard
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed May 9, 2024
1 parent 6384ca1 commit 2a81fe0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 2a81fe0

Please sign in to comment.