Skip to content

Commit

Permalink
FIX: Error when trying to open Preferences (#873)
Browse files Browse the repository at this point in the history
* FIX: Error when trying to open preferences

Added a try-except if self.conf is of type None
  • Loading branch information
Unichronic authored Jan 23, 2025
1 parent cb0f548 commit e2064b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion invesalius/gui/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ def __init__(self, parent):
self.number_colors = 4
self.cluster_volume = None

self.conf = dict(self.session.GetConfig("mep_configuration"))
self.conf = self.session.GetConfig("mep_configuration")
try:
self.conf = dict(self.conf)
except TypeError:
self.conf = {}
self.conf["mep_colormap"] = self.conf.get("mep_colormap", "Viridis")

bsizer = wx.StaticBoxSizer(wx.VERTICAL, self, _("3D Visualization"))
Expand Down

0 comments on commit e2064b0

Please sign in to comment.