@@ -145,23 +145,26 @@ def matches(self, event: Event) -> bool:
145145 return self ._compare (actual_value , self .value )
146146
147147 def _compare (self , actual : Any , expected : str | int | bool ) -> bool :
148- if self .operator == FilterOperator .eq :
149- return actual == expected
150- elif self .operator == FilterOperator .ne :
151- return actual != expected
152- elif self .operator == FilterOperator .gt :
153- return actual > expected
154- elif self .operator == FilterOperator .gte :
155- return actual >= expected
156- elif self .operator == FilterOperator .lt :
157- return actual < expected
158- elif self .operator == FilterOperator .lte :
159- return actual <= expected
160- elif self .operator == FilterOperator .like :
161- return str (expected ) in str (actual )
162- elif self .operator == FilterOperator .not_like :
163- return str (expected ) not in str (actual )
164- return False
148+ try :
149+ if self .operator == FilterOperator .eq :
150+ return actual == expected
151+ elif self .operator == FilterOperator .ne :
152+ return actual != expected
153+ elif self .operator == FilterOperator .gt :
154+ return actual > expected
155+ elif self .operator == FilterOperator .gte :
156+ return actual >= expected
157+ elif self .operator == FilterOperator .lt :
158+ return actual < expected
159+ elif self .operator == FilterOperator .lte :
160+ return actual <= expected
161+ elif self .operator == FilterOperator .like :
162+ return str (expected ) in str (actual )
163+ elif self .operator == FilterOperator .not_like :
164+ return str (expected ) not in str (actual )
165+ return False
166+ except TypeError :
167+ return False
165168
166169
167170class FilterConjunction (StrEnum ):
0 commit comments