on xenial help sign in
add a check for a valid application
commit576de940e74656fd6f80340bf211f71c8b1ee2d5 authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 22 May 2014, 14:46 (12 years ago) parent1564e33
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):
@@ -291,6 +293,10 @@ void LauncherModel::applicationAdded(const QModelIndex &parent, int row)
291293 Q_UNUSED(parent);
292294
293295 ApplicationInfoInterface *app = m_appManager->get(row);
296+ if (!app) {
297+ qWarning() << "LauncherModel received an applicationAdded signal, but there's no such application!";
298+ return;
299+ }
294300
295301 bool found = false;
296302 Q_FOREACH(LauncherItem *item, m_list) {