Containment: Don't emit appletCreated with null applet

ContainmentPrivate::createApplet may return null pointer
(eg. when desktop is immutable), so check the pointer before
emitting appletCreated.

REVIEW: 126449
BUG: 356428
This commit is contained in:
David Rosca 2015-12-21 14:58:14 +01:00
parent 2d1a3364b8
commit bca8e87531

View File

@ -364,7 +364,9 @@ void Containment::setLocation(Types::Location location)
Applet *Containment::createApplet(const QString &name, const QVariantList &args)
{
Plasma::Applet *applet = d->createApplet(name, args);
emit appletCreated(applet);
if (applet) {
emit appletCreated(applet);
}
return applet;
}