From 36797e846ca685140e166a015b9cee066faf960e Mon Sep 17 00:00:00 2001 From: Pranav Gaikwad Date: Mon, 31 Jul 2023 08:16:39 -0400 Subject: [PATCH] :bug: fix file incidents Signed-off-by: Pranav Gaikwad --- engine/conditions.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/conditions.go b/engine/conditions.go index 15f00f1d..e195d604 100644 --- a/engine/conditions.go +++ b/engine/conditions.go @@ -265,7 +265,9 @@ func (ce ConditionEntry) Evaluate(ctx context.Context, log logr.Logger, condCtx func incidentsToFilepaths(incident []IncidentContext) []string { filepaths := []string{} for _, ic := range incident { - filepaths = append(filepaths, ic.FileURI.Filename()) + if _, err := uri.Parse(string(ic.FileURI)); err == nil { + filepaths = append(filepaths, ic.FileURI.Filename()) + } } return filepaths }