From 9c38e3659a79ed6f688c28357e2acec283139685 Mon Sep 17 00:00:00 2001 From: Angelo Naselli Date: Thu, 23 Apr 2020 23:12:08 +0200 Subject: [PATCH] Fixed another crash at startup with missing or empty settings entry into configuration file --- CMakeLists.txt | 2 +- Changes | 5 +++++ dnfdragora/ui.py | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0544db17..a83559ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ if(POLICY CMP0048) cmake_policy(SET CMP0048 NEW) endif(POLICY CMP0048) -project(dnfdragora VERSION 2.0.1 LANGUAGES NONE) +project(dnfdragora VERSION 2.0.2 LANGUAGES NONE) cmake_minimum_required(VERSION 3.4) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") diff --git a/Changes b/Changes index 6ef91c83..ca71540a 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +2020-04-23 v. 2.0.2 +--------------------- +- Fixed another crash at startup with missing or empty settings + entry into configuration file + 2020-04-13 v. 2.0.1 --------------------- - Fixed a crash at startup with missing settings entry into configuration file diff --git a/dnfdragora/ui.py b/dnfdragora/ui.py index 6c05d6eb..e4957924 100644 --- a/dnfdragora/ui.py +++ b/dnfdragora/ui.py @@ -316,6 +316,8 @@ def _configFileRead(self) : user_settings = {} if self.config.userPreferences: if 'settings' in self.config.userPreferences.keys() : + if self.config.userPreferences['settings'] is None: + self.config.userPreferences['settings'] = {} user_settings = self.config.userPreferences['settings'] #### MetaData if 'metadata' in user_settings.keys(): @@ -349,9 +351,6 @@ def _configFileRead(self) : self.log_directory = log['directory'] if 'level_debug' in log.keys() : self.level_debug = log['level_debug'] - else: - # NOTE that should not happen since userPreferences should at least empty dictionary - self.config.userPreferences = {} # metadata settings is needed adding it to update old configuration files if not 'settings' in self.config.userPreferences.keys() :