File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -334,7 +334,16 @@ bool QgsAuthOAuth2Config::loadConfigTxt(
334
334
QgsDebugMsg ( QStringLiteral ( " Error parsing JSON: %1" ).arg ( QString ( errStr ) ) );
335
335
return res;
336
336
}
337
- QJsonWrapper::qvariant2qobject ( variant.toMap (), this );
337
+ 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 );
338
347
break ;
339
348
}
340
349
default :
You can’t perform that action at this time.
0 commit comments