Prevent error when icons are missing

This commit is contained in:
XANTRONIX Development 2024-01-04 20:27:14 -05:00
parent 97556d6f9c
commit 8468ff47a4

View file

@ -37,7 +37,8 @@ class ISO7000Icon():
self.surface = render_to_image(path, width, height, style) self.surface = render_to_image(path, width, height, style)
def __del__(self): 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): def draw(self, cr: cairo.Context, x: float, y: float):
cr.set_source_surface(self.surface, x, y) cr.set_source_surface(self.surface, x, y)