You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2023/03/21 16:13:51 UTC

[superset] branch master updated: fix: safe check when computing chart thumbnail (#23432)

This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 226b60bc4f fix: safe check when computing chart thumbnail (#23432)
226b60bc4f is described below

commit 226b60bc4f789e94880eb1bb0c06667be09e13f9
Author: Zef Lin <ze...@preset.io>
AuthorDate: Tue Mar 21 09:13:38 2023 -0700

    fix: safe check when computing chart thumbnail (#23432)
---
 superset/tasks/thumbnails.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/superset/tasks/thumbnails.py b/superset/tasks/thumbnails.py
index d76939a07e..03b3999dce 100644
--- a/superset/tasks/thumbnails.py
+++ b/superset/tasks/thumbnails.py
@@ -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(