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)