Don't Assert
authorAlan Alpert <alan.alpert@nokia.com>
Tue, 8 May 2012 06:48:30 +0000 (16:48 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 25 Jun 2012 06:57:36 +0000 (08:57 +0200)
It's better to have run-time errors in certain uses of the property than
to assert when trying to access it.

Change-Id: I913eea3fe275ee41358ac8d56bd597faf8e613ad
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
src/qml/qml/qqmlpropertycache.cpp

index 87e707d..d922b99 100644 (file)
@@ -210,7 +210,8 @@ void QQmlPropertyData::lazyLoad(const QMetaMethod &m)
     propType = QMetaType::Void;
 
     const char *returnType = m.typeName();
-    Q_ASSERT(returnType != 0);
+    if (!returnType)
+        returnType = "\0";
     if ((*returnType != 'v') || (qstrcmp(returnType+1, "oid") != 0)) {
         propTypeName = returnType;
         flags |= NotFullyResolved;