From c0f74cd0a3e4a56b701b168e47f7347fba3234c4 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 21 Apr 2017 23:43:40 -0400 Subject: [PATCH] Fix old issue with trying to open previous fits that don't exist. --- gui/itemStats.py | 2 +- gui/mainFrame.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/itemStats.py b/gui/itemStats.py index 6dbec6a9e..788414292 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -1381,7 +1381,7 @@ class ItemProperties(wx.Panel): else: attrName = name.title() value = getattr(self.item, name) - except Exception as e: + except: # TODO: Add logging to this. # We couldn't get a property for some reason. Skip it for now. continue diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 8a66e78d2..5e1ad08c6 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -255,7 +255,9 @@ class MainFrame(wx.Frame): # Remove any fits that cause exception when fetching (non-existent fits) for id in fits[:]: try: - sFit.getFit(id, basic=True) + fit = sFit.getFit(id, basic=True) + if fit is None: + fits.remove(id) except: fits.remove(id)