diff --git a/src/components/other/colors/Colors.cpp b/src/components/other/colors/Colors.cpp index 11cb24b75..2fd4a1c13 100644 --- a/src/components/other/colors/Colors.cpp +++ b/src/components/other/colors/Colors.cpp @@ -66,12 +66,15 @@ void Colors::useConfig (const shared_ptr &config) { // ----------------------------------------------------------------------------- void Colors::overrideColors (const shared_ptr &config) { + if (!config) + return; + const QMetaObject *info = metaObject(); for (int i = info->propertyOffset(); i < info->propertyCount(); ++i) { const QMetaProperty metaProperty = info->property(i); const string colorName = metaProperty.name(); - const string colorValue = config ? config->getString(COLORS_SECTION, colorName, "") : ""; + const string colorValue = config->getString(COLORS_SECTION, colorName, ""); if (!colorValue.empty()) setProperty(colorName.c_str(), QColor(::Utils::coreStringToAppString(colorValue)));