From e18e08c2f1913bf07cff5cbe3635d34f06fb7fc1 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 15 Sep 2011 21:05:06 +0200 Subject: [PATCH] don't cache empty sources --- declarativeimports/core/datasource.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/declarativeimports/core/datasource.cpp b/declarativeimports/core/datasource.cpp index a5bc4aca8..f67a28460 100644 --- a/declarativeimports/core/datasource.cpp +++ b/declarativeimports/core/datasource.cpp @@ -185,7 +185,11 @@ QStringList DataSource::keysForSource(const QString &source) const Plasma::Service *DataSource::serviceForSource(const QString &source) { if (!m_services.contains(source)) { - m_services[source] = m_dataEngine->serviceForSource(source); + Plasma::Service *service = m_dataEngine->serviceForSource(source); + if (!service) { + return 0; + } + m_services[source] = service; } return m_services.value(source);