From 15bbf69fcf098a50ff3a22157895a84f909b7a99 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 12 Oct 2018 23:58:51 -0400 Subject: [PATCH] Check to make sure the bitmap exists before converting to image. --- gui/bitmap_loader.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/bitmap_loader.py b/gui/bitmap_loader.py index e9590e6b8..dd7b3cc00 100644 --- a/gui/bitmap_loader.py +++ b/gui/bitmap_loader.py @@ -73,7 +73,11 @@ class BitmapLoader(object): @classmethod def getImage(cls, name, location): - return cls.getBitmap(name, location).ConvertToImage() + bmp = cls.getBitmap(name, location) + if bmp is not None: + return bmp.ConvertToImage() + else: + return None @classmethod def loadBitmap(cls, name, location):