summaryrefslogtreecommitdiff
path: root/sowatchd/watchhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sowatchd/watchhandler.cpp')
-rw-r--r--sowatchd/watchhandler.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/sowatchd/watchhandler.cpp b/sowatchd/watchhandler.cpp
index 4cd86d3..cc75d45 100644
--- a/sowatchd/watchhandler.cpp
+++ b/sowatchd/watchhandler.cpp
@@ -117,9 +117,15 @@ void WatchHandler::updateWatchlets()
// We need to add this watchlet
const QString id = newWatchlets[i];
Watchlet *watchlet = createWatchlet(id);
- _watchlet_order << id;
- _watchlets[id] = watchlet;
- _server->addWatchlet(watchlet);
+ if (watchlet) {
+ _watchlet_order << id;
+ _watchlets[id] = watchlet;
+ _server->addWatchlet(watchlet);
+ } else {
+ qWarning() << "Failed to load watchlet" << id;
+ newWatchlets.removeAt(i);
+ i--; // Retry
+ }
} else if (newWatchlets[i] != _watchlet_order[i]) {
// Let's find out if this watchlet has been moved, or removed.
const QString id = _watchlet_order[i];