Merge pull request #5369 from dmitrio95/workspace-local-prefs-crash

Fix a crash on reading a workspace with non-existing preferences
This commit is contained in:
Dmitri Ovodok 2019-10-07 16:06:34 +02:00 committed by GitHub
commit 6c0bef1256
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -227,7 +227,7 @@ QVariant Preferences::defaultValue(const QString key) const
{ {
checkIfKeyExists(key); checkIfKeyExists(key);
Preference* pref = _allPreferences.value(key); Preference* pref = _allPreferences.value(key);
return pref->defaultValue(); return pref ? pref->defaultValue() : QVariant();
} }
QSettings* Preferences::settings() const QSettings* Preferences::settings() const