diff --git a/pkg/yamlpath/filter.go b/pkg/yamlpath/filter.go index f35a8d9..dead191 100644 --- a/pkg/yamlpath/filter.go +++ b/pkg/yamlpath/filter.go @@ -290,7 +290,7 @@ func matchRegularExpression(parseTree *filterNode) filter { func stringMatchesRegularExpression(s, expr typedValue) bool { if s.typ != stringValueType || expr.typ != regularExpressionValueType { - panic("unexpected types") // should never happen + return false // can't compare types so return false } re, _ := regexp.Compile(expr.val) // regex already compiled during lexing return re.Match([]byte(s.val))