Skip to content

Commit 9bc8e6f

Browse files
authored
Merge pull request #506 from mathoudebine/fix/453-attributeerror-nonetype-object-has-no-attribute-get
2 parents 925ac9b + bfa9457 commit 9bc8e6f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

configure.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,16 @@ def load_config_values(self):
271271
with open("config.yaml", "rt", encoding='utf8') as stream:
272272
self.config, ind, bsi = ruamel.yaml.util.load_yaml_guess_indent(stream)
273273

274+
# Check if theme is valid
275+
if get_theme_data(self.config['config']['THEME']) is None:
276+
# Theme from config.yaml is not valid: use first theme available default size 3.5"
277+
self.config['config']['THEME'] = get_themes(SIZE_3_5_INCH)[0]
278+
274279
try:
275280
self.theme_cb.set(self.config['config']['THEME'])
276281
except:
277-
self.theme_cb.current(0)
278-
# self.load_theme_size()
282+
self.theme_cb.set("")
283+
279284
self.load_theme_preview()
280285

281286
try:
@@ -361,7 +366,6 @@ def save_config_values(self):
361366
ruamel.yaml.YAML().dump(self.config, file)
362367

363368
def on_theme_change(self, e=None):
364-
# self.load_theme_size()
365369
self.load_theme_preview()
366370

367371
def on_theme_editor_click(self):

0 commit comments

Comments
 (0)