Skip to content

Commit 23b31ab

Browse files
MartinDelillewing328
authored andcommitted
[qt5cpp] Fix crash when API return a map container (#7933)
* [qt5cpp] Fix crash when API return a map container * qint32 => {{returnBaseType}}
1 parent 1b8df5c commit 23b31ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,9 @@ void
185185
QJsonObject obj = doc.object();
186186

187187
foreach(QString key, obj.keys()) {
188-
qint32* val;
188+
{{returnBaseType}} val;
189189
setValue(&val, obj[key], "{{returnBaseType}}", QString());
190-
output->insert(key, *val);
190+
output->insert(key, val);
191191
}
192192
{{/isMapContainer}}
193193
{{^isMapContainer}}

samples/client/petstore/qt5cpp/client/SWGStoreApi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ SWGStoreApi::getInventoryCallback(SWGHttpRequestWorker * worker) {
126126
QJsonObject obj = doc.object();
127127

128128
foreach(QString key, obj.keys()) {
129-
qint32* val;
129+
qint32 val;
130130
setValue(&val, obj[key], "qint32", QString());
131-
output->insert(key, *val);
131+
output->insert(key, val);
132132
}
133133
worker->deleteLater();
134134

0 commit comments

Comments
 (0)