Skip to content

Commit 9c38e36

Browse files
committed
Fixed another crash at startup with missing or empty settings entry into configuration file
1 parent b91f08e commit 9c38e36

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ if(POLICY CMP0048)
22
cmake_policy(SET CMP0048 NEW)
33
endif(POLICY CMP0048)
44

5-
project(dnfdragora VERSION 2.0.1 LANGUAGES NONE)
5+
project(dnfdragora VERSION 2.0.2 LANGUAGES NONE)
66
cmake_minimum_required(VERSION 3.4)
77

88
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

Diff for: Changes

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2020-04-23 v. 2.0.2
2+
---------------------
3+
- Fixed another crash at startup with missing or empty settings
4+
entry into configuration file
5+
16
2020-04-13 v. 2.0.1
27
---------------------
38
- Fixed a crash at startup with missing settings entry into configuration file

Diff for: dnfdragora/ui.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ def _configFileRead(self) :
316316
user_settings = {}
317317
if self.config.userPreferences:
318318
if 'settings' in self.config.userPreferences.keys() :
319+
if self.config.userPreferences['settings'] is None:
320+
self.config.userPreferences['settings'] = {}
319321
user_settings = self.config.userPreferences['settings']
320322
#### MetaData
321323
if 'metadata' in user_settings.keys():
@@ -349,9 +351,6 @@ def _configFileRead(self) :
349351
self.log_directory = log['directory']
350352
if 'level_debug' in log.keys() :
351353
self.level_debug = log['level_debug']
352-
else:
353-
# NOTE that should not happen since userPreferences should at least empty dictionary
354-
self.config.userPreferences = {}
355354

356355
# metadata settings is needed adding it to update old configuration files
357356
if not 'settings' in self.config.userPreferences.keys() :

0 commit comments

Comments
 (0)