don't crash on failed launch

This commit is contained in:
Aaron Seigo 2011-09-22 18:35:45 +02:00
parent a810cd2ab0
commit 691f590664

View File

@ -100,7 +100,8 @@ KSharedPtr<UiLoader> SimpleJavaScriptApplet::s_widgetLoader;
QHash<QString, Plasma::Animator::Animation> SimpleJavaScriptApplet::s_animationDefs; QHash<QString, Plasma::Animator::Animation> SimpleJavaScriptApplet::s_animationDefs;
SimpleJavaScriptApplet::SimpleJavaScriptApplet(QObject *parent, const QVariantList &args) SimpleJavaScriptApplet::SimpleJavaScriptApplet(QObject *parent, const QVariantList &args)
: AbstractJsAppletScript(parent) : AbstractJsAppletScript(parent),
m_interface(0)
{ {
Q_UNUSED(args); Q_UNUSED(args);
// kDebug() << "Script applet launched, args" << applet()->startupArguments(); // kDebug() << "Script applet launched, args" << applet()->startupArguments();
@ -231,6 +232,10 @@ void SimpleJavaScriptApplet::paintInterface(QPainter *p, const QStyleOptionGraph
QList<QAction*> SimpleJavaScriptApplet::contextualActions() QList<QAction*> SimpleJavaScriptApplet::contextualActions()
{ {
if (!m_interface) {
return QList<QAction *>();
}
return m_interface->contextualActions(); return m_interface->contextualActions();
} }