aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcomponent_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-03-16 13:35:59 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-03-17 15:01:14 +0100
commit51c6db3f3d9843faa7ab3a1839bce17cd4418bd2 (patch)
tree5d8cdb8f57f662091a168bfba4d9fac30b0ddf1a /src/qml/qml/qqmlcomponent_p.h
parente936e466a57824470a7bcdc69ec6e22899555a49 (diff)
QtQml: Check CU for null on isBound()
If the component has an error or was clear()'d its CU will be null. Since isBound() is a public method, it should take that into account rather than just crash. Pick-to: 6.5 Change-Id: I4a3e7417da3c87f6ce7dbb615f984815bc2b0b0b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlcomponent_p.h')
-rw-r--r--src/qml/qml/qqmlcomponent_p.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h
index d76e1c24a3..31cbf0a4fc 100644
--- a/src/qml/qml/qqmlcomponent_p.h
+++ b/src/qml/qml/qqmlcomponent_p.h
@@ -164,7 +164,8 @@ public:
QQmlContext *context, CreateBehavior behavior = CreateDefault);
bool isBound() const {
- return compilationUnit->unitData()->flags & QV4::CompiledData::Unit::ComponentsBound;
+ return compilationUnit
+ && (compilationUnit->unitData()->flags & QV4::CompiledData::Unit::ComponentsBound);
}
};