Task-number: QTBUG-21883
Change-Id: Ic14a5d494890fc1bc322c660b97f657d640f2ff8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
attached.output = currentReg;
attached.reg = currentReg;
attached.exceptionId = exceptionId(e->line, e->column);
- Q_ASSERT(e->declarativeType->attachedPropertiesId() != -1);
+ if (e->declarativeType->attachedPropertiesId() == -1)
+ discard();
attached.id = e->declarativeType->attachedPropertiesId();
gen(attached);
} break;
--- /dev/null
+import Qt.v4 1.0
+
+Result {
+ property Result dummy: Result
+}
void qtscript_data();
void nestedObjectAccess();
void subscriptionsInConditionalExpressions();
+ void qtbug_21883();
private:
QDeclarativeEngine engine;
delete o;
}
+// Crash test
+void tst_v4::qtbug_21883()
+{
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_21883.qml"));
+
+ QString warning = component.url().toString() + ":4: Unable to assign null to ResultObject*";
+ QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ delete o;
+}
+
QTEST_MAIN(tst_v4)
#include "tst_v4.moc"