diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-01-07 13:13:43 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-01-08 07:52:41 +0000 |
commit | 0999c78ea33d71ba211b7fa90a5d88dd5b29b3fd (patch) | |
tree | 07029568cc1fd2cb97a8ef9e62b985943725b04e /tests/auto/quick/propertyrequirements | |
parent | 5ed082ea4ce3580134a9a0c83e6fdb81a6231c8e (diff) |
Avoid crash in property requirements test
Pure QML types do not have a meta object hierarchy associated with them.
The test is only supposed to test C++ types, though. We can ignore the
types without meta objects.
Change-Id: I2a40bc0023f6d335c4dbdbc04818da60f47d8787
Fixes: QTBUG-72637
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick/propertyrequirements')
-rw-r--r-- | tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp b/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp index fbcd53cad4..34be4d98b4 100644 --- a/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp +++ b/tests/auto/quick/propertyrequirements/tst_propertyrequirements.cpp @@ -175,8 +175,10 @@ void tst_PropertyRequirements::testQmlType(TestDepth testDepth, const QQmlType & // check if this type is derived from QObject and even can have signals // i.e. weed out the Q_GADGET classes - if (inheritanceHierarchy.first()->className() != QByteArray("QObject")) + if (inheritanceHierarchy.isEmpty() + || inheritanceHierarchy.constFirst()->className() != QByteArrayLiteral("QObject")) { return; + } if (testDepth == MainTypeOnly) { inheritanceHierarchy.clear(); |