diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-01-07 13:59:43 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-01-11 15:21:54 +0100 |
commit | 30136b1a82bfc54459741483e76f2f70c937dedd (patch) | |
tree | 12151f821f667d1763cdd477841ab6fbafb2a641 /src | |
parent | 29e8c3a50bff884dc64d294707cae5cdec2ed097 (diff) |
Avoid crash for deep aliases
Aliases are seriously broken and need a larger overhaul.
This patch at least prevents the application from crashing.
Task-number: QTBUG-89822
Change-Id: Ib6acc5b6f621a902f7f5ce370043986486f3c0d0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmlpropertycachecreator_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h index fe34389b28..ce1a830979 100644 --- a/src/qml/qml/qqmlpropertycachecreator_p.h +++ b/src/qml/qml/qqmlpropertycachecreator_p.h @@ -860,6 +860,10 @@ inline QQmlError QQmlPropertyCacheAliasCreator<ObjectContainer>::propertyDataFor Q_ASSERT(targetCache); targetProperty = targetCache->property(valueTypeIndex); + if (targetProperty == nullptr) { + return qQmlCompileError(alias.referenceLocation, + QQmlPropertyCacheCreatorBase::tr("Invalid alias target")); + } *type = targetProperty->propType(); writable = targetProperty->isWritable(); |