Don't crash if the plasmoid wasn't properly loaded
If d->applet->package().isValid(), then d->qmlObject->mainComponent() is null. This makes Plasma crash when a faulty plasmoid is loaded. REVIEW: 120581
This commit is contained in:
parent
71444986ee
commit
8df7801d3b
@ -437,7 +437,7 @@ void AppletQuickItem::init()
|
||||
|
||||
d->qmlObject->setSource(QUrl::fromLocalFile(d->applet->package().filePath("mainscript")));
|
||||
|
||||
if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() || d->qmlObject->mainComponent()->isError()) {
|
||||
if (!engine || !engine->rootContext() || !engine->rootContext()->isValid() || !d->qmlObject->mainComponent() || d->qmlObject->mainComponent()->isError()) {
|
||||
QString reason;
|
||||
if (d->applet->package().isValid()) {
|
||||
foreach (QQmlError error, d->qmlObject->mainComponent()->errors()) {
|
||||
|
Loading…
Reference in New Issue
Block a user