Skip to content

Commit

Permalink
Fixed another crash at startup with missing or empty settings entry i…
Browse files Browse the repository at this point in the history
…nto configuration file
  • Loading branch information
anaselli committed Apr 23, 2020
1 parent b91f08e commit 9c38e36
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 2 additions & 3 deletions dnfdragora/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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() :
Expand Down

0 comments on commit 9c38e36

Please sign in to comment.