We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5dc84d commit b8361e4Copy full SHA for b8361e4
src/auth/oauth2/qgsauthoauth2config.cpp
@@ -334,7 +334,16 @@ bool QgsAuthOAuth2Config::loadConfigTxt(
334
QgsDebugMsg( QStringLiteral( "Error parsing JSON: %1" ).arg( QString( errStr ) ) );
335
return res;
336
}
337
- QJsonWrapper::qvariant2qobject( variant.toMap(), this );
+ const QVariantMap variantMap = variant.toMap();
338
+ // safety check -- qvariant2qobject asserts if an non-matching property is found in the json
339
+ for ( QVariantMap::const_iterator iter = variantMap.constBegin(); iter != variantMap.constEnd(); ++iter )
340
+ {
341
+ QVariant property = this->property( iter.key().toLatin1() );
342
+ if ( !property.isValid() ) // e.g. not a auth config json file
343
+ return false;
344
+ }
345
+
346
+ QJsonWrapper::qvariant2qobject( variantMap, this );
347
break;
348
349
default:
0 commit comments