fix default value for getter with null objects

This commit is contained in:
Andrei Yankovich 2021-11-19 00:34:50 +03:00
parent d7e11e644c
commit c27ca21445

View File

@ -35,7 +35,13 @@ QVariant ISettings::getValue(const QString &key, const QVariant &def) {
_cache[key] = getValueImplementation(key, def); _cache[key] = getValueImplementation(key, def);
} }
return _cache.value(key, def); auto result = _cache.value(key, def);
if (result.isNull()) {
return def;
}
return result;
} }
QString ISettings::getStrValue(const QString &key, const QString &def) { QString ISettings::getStrValue(const QString &key, const QString &def) {