AppletQuickItem: Do not access KPluginInfo if not valid

When loading an applet which does not exist, we create a dummy applet
which just contains the error message. This dummy does not have a valid
KPluginInfo, and using an invalid KPluginInfo causes as assert to be
hit.

Reviewed-By: Marco and Sebas
This commit is contained in:
Vishesh Handa 2015-06-18 22:51:15 +02:00
parent aa52188364
commit 9976edcbc9

View File

@ -53,6 +53,12 @@ AppletQuickItemPrivate::AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickIte
applet(a),
expanded(false)
{
if (!a->pluginInfo().isValid()) {
// This `qmlObject` is used in other parts of the code
qmlObject = new KDeclarative::QmlObject(q);
return;
}
//TODO: remove the legacy support at some point
//use the shared engine only for applets that are nt in the legacy list
//if they are, use the shared engine if their mayor version is at least 3