Don't crash

Apparently, q->rootObject() can be invalid here.
This commit is contained in:
Sebastian Kügler 2013-12-08 05:50:15 +01:00
parent 1d28b028b1
commit 73e3c4a6ed

View File

@ -111,7 +111,11 @@ void PlasmaQuickViewPrivate::setContainment(Plasma::Containment *cont)
(cont->containmentType() == Plasma::Types::DesktopContainment ||
cont->containmentType() == Plasma::Types::CustomContainment));
graphicObject->setParentItem(q->rootObject());
q->rootObject()->setProperty("containment", QVariant::fromValue(graphicObject));
if (q->rootObject()) {
q->rootObject()->setProperty("containment", QVariant::fromValue(graphicObject));
} else {
qWarning() << "Could not set containment property on rootObject";
}
} else {
qWarning() << "Containment graphic object not valid";
}