Skip to content

Commit

Permalink
don't crash when there is no data
Browse files Browse the repository at this point in the history
  • Loading branch information
yeger00 authored Oct 27, 2024
1 parent ba973eb commit 702af3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redash/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,9 @@ def get_by_id_and_org(cls, object_id, org):
return super(Alert, cls).get_by_id_and_org(object_id, org, Query)

def evaluate(self):
data = self.query_rel.latest_query_data.data
data = self.query_rel.latest_query_data.data if self.query_rel.latest_query_data else None

if data["rows"] and self.options["column"] in data["rows"][0]:
if data and data["rows"] and self.options["column"] in data["rows"][0]:
op = OPERATORS.get(self.options["op"], lambda v, t: False)

if "selector" not in self.options:
Expand Down

0 comments on commit 702af3e

Please sign in to comment.