From 8468ff47a4bb8b22227b69145f7d5ec47fba657d Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Thu, 4 Jan 2024 20:27:14 -0500 Subject: [PATCH] Prevent error when icons are missing --- py/hexagram/icons.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/hexagram/icons.py b/py/hexagram/icons.py index 8c952d4..d4d7920 100644 --- a/py/hexagram/icons.py +++ b/py/hexagram/icons.py @@ -37,7 +37,8 @@ class ISO7000Icon(): self.surface = render_to_image(path, width, height, style) def __del__(self): - self.surface.finish() + if self.surface is not None: + self.surface.finish() def draw(self, cr: cairo.Context, x: float, y: float): cr.set_source_surface(self.surface, x, y)