Skip to content

Commit

Permalink
fix: safe check when computing chart thumbnail (#23432)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zef Lin authored Mar 21, 2023
1 parent 7ef06b0 commit 226b60b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/tasks/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def cache_chart_thumbnail(
logger.warning("No cache set, refusing to compute")
return None
chart = cast(Slice, Slice.get(chart_id))
if not chart:
logger.warning("No chart found, skip computing chart thumbnail")
return None
url = get_url_path("Superset.slice", slice_id=chart.id)
logger.info("Caching chart: %s", url)
_, username = get_executor(
Expand Down

0 comments on commit 226b60b

Please sign in to comment.