When the callback passed to the function returns nullptr,
QQmlData::ensurePropertyCache(e, o) crashes.
Change-Id: I11efd7e9d6c5f18611e796d896384dd14a280303
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
v4->pushGlobalContext();
QObject *o = qobjectCallback(e, e);
setQObjectApi(e, o);
+ if (!o) {
+ qFatal("qmlRegisterSingletonType(): \"%s\" is not available because the callback function returns a null pointer.", qPrintable(typeName));
+ }
// if this object can use a property cache, create it now
QQmlData::ensurePropertyCache(e, o);
v4->popContext();