From 0999c78ea33d71ba211b7fa90a5d88dd5b29b3fd Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 7 Jan 2019 13:13:43 +0100 Subject: [PATCH] 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 --- .../quick/propertyrequirements/tst_propertyrequirements.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();