[fix][settings] crashing when an empty Qt style is defined

This commit is contained in:
Vinícius Moreira
2020-05-05 14:44:55 -03:00
parent 784526a004
commit f076e15119
2 changed files with 7 additions and 3 deletions

View File

@@ -6,7 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [0.9.3] 2020 ## [0.9.3] 2020
### Fixes ### Fixes
- upgrade: crashing for scenarios when there are packages that cannot upgrade to be displayed on the summary window - upgrade: crashing for scenarios when there are packages that cannot upgrade to be displayed on the summary window
- settings: crashing when an empty Qt style is defined [#104](https://github.com/vinifmor/bauh/issues/104)
## [0.9.2] 2020-05-04 ## [0.9.2] 2020-05-04
### Features ### Features

View File

@@ -171,8 +171,11 @@ class GenericSettingsManager:
default_style = [o for o in style_opts if o.value == cur_style] default_style = [o for o in style_opts if o.value == cur_style]
if not default_style: if not default_style:
default_style = InputOption(label=cur_style, value=cur_style) if cur_style:
style_opts.append(default_style) default_style = InputOption(label=cur_style, value=cur_style)
style_opts.append(default_style)
else:
default_style = style_opts[0]
else: else:
default_style = default_style[0] default_style = default_style[0]