forked from qt-creator/qt-creator
QmlDesigner: Remove potentially excessive values from dataStore records
Change-Id: Ib2606fc50662b7724ae2ba11d21264334638bec9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
@@ -853,8 +853,13 @@ CollectionDetails CollectionDetails::fromLocalCollection(const QJsonObject &loca
|
||||
|
||||
if (int columnsCount = result.columns()) {
|
||||
const QJsonArray dataRecords = localCollection.value("data").toArray();
|
||||
for (const QJsonValue &dataRecordValue : dataRecords)
|
||||
result.insertRecords(dataRecordValue.toArray());
|
||||
for (const QJsonValue &dataRecordValue : dataRecords) {
|
||||
QJsonArray dataRecord = dataRecordValue.toArray();
|
||||
while (dataRecord.count() > columnsCount)
|
||||
dataRecord.removeLast();
|
||||
|
||||
result.insertRecords(dataRecord);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setError(CollectionParseError::ColumnsBlockIsNotArray);
|
||||
|
Reference in New Issue
Block a user