diff --git a/src/components/other/colors/Colors.cpp b/src/components/other/colors/Colors.cpp index f83e4d9ba..11cb24b75 100644 --- a/src/components/other/colors/Colors.cpp +++ b/src/components/other/colors/Colors.cpp @@ -71,7 +71,7 @@ void Colors::overrideColors (const shared_ptr &config) { for (int i = info->propertyOffset(); i < info->propertyCount(); ++i) { const QMetaProperty metaProperty = info->property(i); const string colorName = metaProperty.name(); - const string colorValue = config->getString(COLORS_SECTION, colorName, ""); + const string colorValue = config ? config->getString(COLORS_SECTION, colorName, "") : ""; if (!colorValue.empty()) setProperty(colorName.c_str(), QColor(::Utils::coreStringToAppString(colorValue))); diff --git a/src/components/settings/SettingsModel.cpp b/src/components/settings/SettingsModel.cpp index 5e3d1c829..88eb40628 100644 --- a/src/components/settings/SettingsModel.cpp +++ b/src/components/settings/SettingsModel.cpp @@ -773,11 +773,11 @@ void SettingsModel::setLogsEmail (const QString &email) { // --------------------------------------------------------------------------- QString SettingsModel::getLogsFolder (const shared_ptr &config) { - return ::Utils::coreStringToAppString( - config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath()) - ); + return ::Utils::coreStringToAppString(config + ? config->getString(UI_SECTION, "logs_folder", Paths::getLogsDirPath()) + : Paths::getLogsDirPath()); } bool SettingsModel::getLogsEnabled (const shared_ptr &config) { - return config->getInt(UI_SECTION, "logs_enabled", false); + return config ? config->getInt(UI_SECTION, "logs_enabled", false) : false; }