make sure we don't access an invalid config and crash

This commit is contained in:
Sebastian Kügler 2013-04-23 18:17:08 +02:00
parent e1f17c63b6
commit db5ef57480

View File

@ -147,7 +147,11 @@ void AppletInterface::init()
}
Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage("Plasma/Generic");
pkg.setPath(defaults.readEntry("ToolBox", "org.kde.toolbox"));
if (defaults.isValid()) {
pkg.setPath(defaults.readEntry("ToolBox", "org.kde.toolbox"));
} else {
pkg.setPath("org.kde.toolbox");
}
if (pkg.isValid()) {
QObject *toolBoxObject = m_qmlObject->createObjectFromSource(QUrl::fromLocalFile(pkg.filePath("mainscript")));