Skip to content

Commit 48e1b1f

Browse files
feat(bug): defensive code to avoid accesing attribute of a NoneType object (#35219)
1 parent 5ec8f9d commit 48e1b1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

superset/dashboards/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,8 @@ def thumbnail(self, pk: int, digest: str, **kwargs: Any) -> WerkzeugResponse:
13421342
self.incr_stats("from_cache", self.thumbnail.__name__)
13431343
try:
13441344
image = cache_payload.get_image()
1345+
if not image or not hasattr(image, "read"):
1346+
return self.response_404()
13451347
except ScreenshotImageNotAvailableException:
13461348
return self.response_404()
13471349
return Response(

0 commit comments

Comments
 (0)