From a3ca8b531172de60286ddcb5840015cbc565023a Mon Sep 17 00:00:00 2001 From: BarbourSmith Date: Mon, 3 Sep 2018 11:54:09 -0700 Subject: [PATCH] Fix crash when background image deleted Ground control would crash on launch if the background image was deleted --- UIElements/backgroundMenu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UIElements/backgroundMenu.py b/UIElements/backgroundMenu.py index 5ae537a5..96d8389f 100644 --- a/UIElements/backgroundMenu.py +++ b/UIElements/backgroundMenu.py @@ -58,8 +58,7 @@ def reloadBackground(self): self.close() def processBackground(self): - if self.data.backgroundFile == "" or os.path.isdir( - self.data.backgroundFile): + if self.data.backgroundFile == "" or os.path.isdir(self.data.backgroundFile) or not os.path.isfile(self.data.backgroundFile): self.data.backgroundTexture = None self.data.backgroundManualReg = [] self.updateAlignmentInConfig()