Skip to content

Commit

Permalink
[qt5cpp] Fix crash when API return a map container (#7933)
Browse files Browse the repository at this point in the history
* [qt5cpp] Fix crash when API return a map container

* qint32 => {{returnBaseType}}
  • Loading branch information
MartinDelille authored and wing328 committed Apr 2, 2018
1 parent 1b8df5c commit 23b31ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ void
QJsonObject obj = doc.object();

foreach(QString key, obj.keys()) {
qint32* val;
{{returnBaseType}} val;
setValue(&val, obj[key], "{{returnBaseType}}", QString());
output->insert(key, *val);
output->insert(key, val);
}
{{/isMapContainer}}
{{^isMapContainer}}
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ SWGStoreApi::getInventoryCallback(SWGHttpRequestWorker * worker) {
QJsonObject obj = doc.object();

foreach(QString key, obj.keys()) {
qint32* val;
qint32 val;
setValue(&val, obj[key], "qint32", QString());
output->insert(key, *val);
output->insert(key, val);
}
worker->deleteLater();

Expand Down

0 comments on commit 23b31ab

Please sign in to comment.