mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
handle case where QVariant is not QVariantMap
This commit is contained in:
parent
e88cfc913f
commit
8b2ded1b79
1 changed files with 10 additions and 1 deletions
|
@ -288,7 +288,16 @@ void DomainServerSettingsManager::updateSetting(const QString& key, const QJsonV
|
|||
settingMap[key] = QVariantMap();
|
||||
}
|
||||
|
||||
QVariantMap& thisMap = *reinterpret_cast<QVariantMap*>(settingMap[key].data());
|
||||
QVariant& possibleMap = settingMap[key];
|
||||
|
||||
if (!possibleMap.canConvert(QMetaType::QVariantMap)) {
|
||||
// if this isn't a map then we need to make it one, otherwise we're about to crash
|
||||
qDebug() << "Value at" << key << "was not the expected QVariantMap while updating DS settings"
|
||||
<< "- removing existing value and making it a QVariantMap";
|
||||
possibleMap = QVariantMap();
|
||||
}
|
||||
|
||||
QVariantMap& thisMap = *reinterpret_cast<QVariantMap*>(possibleMap.data());
|
||||
foreach(const QString childKey, newValue.toObject().keys()) {
|
||||
|
||||
QJsonObject childDescriptionObject = settingDescription;
|
||||
|
|
Loading…
Reference in a new issue