Prevent error when icons are missing
This commit is contained in:
parent
97556d6f9c
commit
8468ff47a4
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue