diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-12-08 09:26:36 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-12-08 09:46:04 +0100 |
commit | c3860cd04bbc089ef95bc441a1f8f1e46f9606f8 (patch) | |
tree | 03df7f03f2bceaf5129c2789d0440e66bc37ad2b /src/qmlmodels/qqmllistmodel.cpp | |
parent | 98c189d231535751670145fd7a3eed31ce8aa67d (diff) |
qqmlistmodel: Fix crash when modelCache is null
Fixes: QTBUG-89173
Pick-to: 5.15
Change-Id: Ife82518808fc5504ec42407e80ed3de89ed4adeb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlmodels/qqmllistmodel.cpp')
-rw-r--r-- | src/qmlmodels/qqmllistmodel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qmlmodels/qqmllistmodel.cpp b/src/qmlmodels/qqmllistmodel.cpp index a0f19ce52a..68245ff52c 100644 --- a/src/qmlmodels/qqmllistmodel.cpp +++ b/src/qmlmodels/qqmllistmodel.cpp @@ -713,7 +713,7 @@ void ListModel::set(int elementIndex, QV4::Object *object, ListModel::SetElement } else if (propertyValue->isNullOrUndefined()) { if (reason == SetElement::WasJustInserted) { QQmlError err; - auto memberName = propertyName->toString(m_modelCache->engine())->toQString(); + auto memberName = propertyName->toString(v4)->toQString(); err.setDescription(QString::fromLatin1("%1 is %2. Adding an object with a %2 member does not create a role for it.").arg(memberName, propertyValue->isNull() ? QLatin1String("null") : QLatin1String("undefined"))); qmlWarning(nullptr, err); } else { |