on xenial help sign in
Don't crash when we get an invalid app from ApplicationManager Fixes: 1309162
commit117f17e37b6b3cfa27a66af0f472b74b0effcf3d authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 6 Jun 2014, 11:38 (12 years ago) parent9d7ac18576de94
1 file changed+6
plugins/Unity/Launcher/launchermodel.cpp+6
plugins/Unity/Launcher/launchermodel.cpp+6
@@ -23,6 +23,8 @@
2323
2424#include <unity/shell/application/ApplicationInfoInterface.h>
2525
26+#include <QDebug>
27+
2628using namespace unity::shell::application;
2729
2830LauncherModel::LauncherModel(QObject *parent):
@@ -337,6 +339,10 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
337339 Q_UNUSED(parent);
338340
339341 ApplicationInfoInterface *app = m_appManager->get(row);
342+ if (!app) {
343+ qWarning() << "LauncherModel received an applicationAdded signal, but there's no such application!";
344+ return;
345+ }
340346
341347 bool found = false;
342348 Q_FOREACH(LauncherItem *item, m_list) {