From 6d4cc2e49494fa753d5282ea45618274fce5f8b4 Mon Sep 17 00:00:00 2001 From: Gabriel Torres Ruiz Date: Fri, 19 Sep 2025 17:39:24 -0400 Subject: [PATCH] feat(bug): defensive code to avoid accesing attribute of a NoneType object --- superset/dashboards/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py index 79ce952f25c8..bf77d372d6d8 100644 --- a/superset/dashboards/api.py +++ b/superset/dashboards/api.py @@ -1342,6 +1342,8 @@ def thumbnail(self, pk: int, digest: str, **kwargs: Any) -> WerkzeugResponse: self.incr_stats("from_cache", self.thumbnail.__name__) try: image = cache_payload.get_image() + if not image or not hasattr(image, "read"): + return self.response_404() except ScreenshotImageNotAvailableException: return self.response_404() return Response(