Merge lp:~mzanetti/unity8/dont-crash-on-invalid-app into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Gerry Boland
Approved revision: 914
Merged at revision: 956
Proposed branch: lp:~mzanetti/unity8/dont-crash-on-invalid-app
Merge into: lp:unity8
Diff against target: 23 lines (+6/-0)
1 file modified
plugins/Unity/Launcher/launchermodel.cpp (+6/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/dont-crash-on-invalid-app
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Albert Astals Cid (community) Abstain
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+220636@code.launchpad.net

Commit message

Don't crash when we get an invalid app from ApplicationManager

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

Nope

 * Did you perform an exploratory manual test run of your code change and any related functionality?

Yep

 * Did you make sure that your branch does not contain spurious tags?

Yep

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

nope

 * If you changed the UI, has there been a design review?

nope

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

I think this should go in, crashes are bad, *BUT* I think we should add and enable enough logs (unity-mir has lots of debug but disabled) that we can go look at the logs of someone that has been running the patched for for months and grep for "LauncherModel received an applicationAdded signal, but there's no such application!" and with the logs have enough information to find out what is wrong and what is causing this null application to show up at this level.

Revision history for this message
Albert Astals Cid (aacid) :
review: Abstain
Revision history for this message
Michael Zanetti (mzanetti) wrote :

I fully agree with Albert.

Gerry, can you take care about enabling the debug prints in unity-mir / qtmir?

Revision history for this message
Gerry Boland (gerboland) wrote :

Shouldn't be necessary, but yes good to check

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Y
 * Did CI run pass? If not, please explain why.
Y

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Unity/Launcher/launchermodel.cpp'
2--- plugins/Unity/Launcher/launchermodel.cpp 2014-05-13 11:24:48 +0000
3+++ plugins/Unity/Launcher/launchermodel.cpp 2014-05-22 12:48:45 +0000
4@@ -23,6 +23,8 @@
5
6 #include <unity/shell/application/ApplicationInfoInterface.h>
7
8+#include <QDebug>
9+
10 using namespace unity::shell::application;
11
12 LauncherModel::LauncherModel(QObject *parent):
13@@ -291,6 +293,10 @@
14 Q_UNUSED(parent);
15
16 ApplicationInfoInterface *app = m_appManager->get(row);
17+ if (!app) {
18+ qWarning() << "LauncherModel received an applicationAdded signal, but there's no such application!";
19+ return;
20+ }
21
22 bool found = false;
23 Q_FOREACH(LauncherItem *item, m_list) {

Subscribers

People subscribed via source and target branches