mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-05-07 06:59:44 +00:00
fix default value for getter with null objects
This commit is contained in:
parent
d7e11e644c
commit
c27ca21445
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user