From 4f7ead27d659352efd5104af08f94cea079d35a6 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 13 Jun 2016 10:53:31 +0100 Subject: [PATCH] Fix null object QObject::connect warning REVIEW: 128171 --- src/scriptengines/qml/plasmoid/appletinterface.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/scriptengines/qml/plasmoid/appletinterface.cpp b/src/scriptengines/qml/plasmoid/appletinterface.cpp index a6b9c87aa..df2d64244 100644 --- a/src/scriptengines/qml/plasmoid/appletinterface.cpp +++ b/src/scriptengines/qml/plasmoid/appletinterface.cpp @@ -161,12 +161,14 @@ AppletInterface::AppletInterface(Plasma::Applet *a, const QVariantList &args, QQ connect(applet(), &Plasma::Applet::busyChanged, this, &AppletInterface::busyChanged); - connect(appletScript(), &DeclarativeAppletScript::formFactorChanged, - this, &AppletInterface::formFactorChanged); - connect(appletScript(), &DeclarativeAppletScript::locationChanged, - this, &AppletInterface::locationChanged); - connect(appletScript(), &DeclarativeAppletScript::contextChanged, - this, &AppletInterface::contextChanged); + if (appletScript()) { + connect(appletScript(), &DeclarativeAppletScript::formFactorChanged, + this, &AppletInterface::formFactorChanged); + connect(appletScript(), &DeclarativeAppletScript::locationChanged, + this, &AppletInterface::locationChanged); + connect(appletScript(), &DeclarativeAppletScript::contextChanged, + this, &AppletInterface::contextChanged); + } if (applet()->containment()) { connect(applet()->containment(), &Plasma::Containment::screenChanged,