From f076e151191598e8130fef2c6cbce8f8ab0c91e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Moreira?= Date: Tue, 5 May 2020 14:44:55 -0300 Subject: [PATCH] [fix][settings] crashing when an empty Qt style is defined --- CHANGELOG.md | 3 ++- bauh/view/core/settings.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c86742d..ce44ed24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.9.3] 2020 ### 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 ### Features diff --git a/bauh/view/core/settings.py b/bauh/view/core/settings.py index 4e8936d0..28ffd5ea 100644 --- a/bauh/view/core/settings.py +++ b/bauh/view/core/settings.py @@ -171,8 +171,11 @@ class GenericSettingsManager: default_style = [o for o in style_opts if o.value == cur_style] if not default_style: - default_style = InputOption(label=cur_style, value=cur_style) - style_opts.append(default_style) + if cur_style: + default_style = InputOption(label=cur_style, value=cur_style) + style_opts.append(default_style) + else: + default_style = style_opts[0] else: default_style = default_style[0]