diff --git a/elastalert/ruletypes.py b/elastalert/ruletypes.py index 47509f62..aa64a246 100644 --- a/elastalert/ruletypes.py +++ b/elastalert/ruletypes.py @@ -522,12 +522,15 @@ def add_match(self, match, qk): def find_matches(self, ref, cur): """ Determines if an event spike or dip happening. """ + if ref is None or cur is None: + return False + # Apply threshold limits if self.field_value is None: if (cur < self.rules.get('threshold_cur', 0) or ref < self.rules.get('threshold_ref', 0)): return False - elif ref is None or ref == 0 or cur is None or cur == 0: + elif ref == 0 or cur == 0: return False spike_up, spike_down = False, False