Guard failed testItem creation
Summary: createObjectFromSource can return a null on error. This needs guarding. Reviewers: #plasma, mart Reviewed By: #plasma, mart Subscribers: plasma-devel, #frameworks Tags: #plasma, #frameworks Differential Revision: https://phabricator.kde.org/D7532
This commit is contained in:
parent
2236c19584
commit
a968892ba9
@ -676,8 +676,10 @@ QObject *AppletQuickItem::testItem()
|
||||
}
|
||||
|
||||
d->testItem = d->qmlObject->createObjectFromSource(url, QtQml::qmlContext(rootItem()));
|
||||
if (d->testItem) {
|
||||
d->testItem->setProperty("plasmoidItem", QVariant::fromValue<QObject*>(this));
|
||||
}
|
||||
}
|
||||
|
||||
return d->testItem;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user