Skip to content

Commit

Permalink
Catch exception caused by missing widget parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
rthiermann committed Nov 28, 2023
1 parent 1e0e126 commit 75acca6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/napari_mm3/_deriving_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,11 @@ def _save_settings(self):
name == 'widget_name'.
Apply the saved parameters to the currently extant widgets.
"""
widget_name = self.parent.name
try:
widget_name = self.parent.name
except:
warning('Could not extract widget name to save settings.')
widget_name = ''
history = []
if Path("./history.json").exists():
with open("./history.json", "r") as h:
Expand All @@ -469,6 +473,7 @@ def _save_settings(self):
json.dump(history, h, indent=2)



class TimeRangeSelector(RangeEdit):
def __init__(self, permitted_times):
label_str = f"time range (frames {permitted_times[0]}-{permitted_times[1]})"
Expand Down

0 comments on commit 75acca6

Please sign in to comment.