From 7061235418f779e5d4313e51b73e41a361a29a7f Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Wed, 19 Aug 2015 16:58:16 +0100
Subject: [PATCH] Handle an invalid metadata in PluginLoader

REVIEW: 124823
---
 src/plasma/pluginloader.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp
index f01341a87..bfa5deeec 100644
--- a/src/plasma/pluginloader.cpp
+++ b/src/plasma/pluginloader.cpp
@@ -223,6 +223,7 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
         p.setFallbackPackage(fp);
 
         if (!fp.isValid()) {
+            qWarning() << "invalid fallback path in " << p.path();
             return 0;
         }
     }
@@ -231,8 +232,13 @@ Applet *PluginLoader::loadApplet(const QString &name, uint appletId, const QVari
     // TODO: remove when Plasma 5.4 is released
     {
         KPluginInfo info = KPluginInfo::fromMetaData(p.metadata());
+        if (!info.isValid()) {
+            qWarning() << "invalid plugin in" << p.path();
+            return 0;
+        }
         KPluginLoader loader(info.libraryPath());
         if (!Plasma::isPluginVersionCompatible(loader.pluginVersion())) {
+            qWarning() << "incompatiable plugin version in" << p.path();
             return 0;
         }
         KPluginFactory *factory = loader.factory();