Merge lp:~gordallott/unity/unity.fix-814619 into lp:unity

Proposed by Gord Allott
Status: Merged
Approved by: Neil J. Patel
Approved revision: no longer in the source branch.
Merged at revision: 1314
Proposed branch: lp:~gordallott/unity/unity.fix-814619
Merge into: lp:unity
Diff against target: 40 lines (+16/-1)
1 file modified
plugins/unityshell/src/SimpleLauncherIcon.cpp (+16/-1)
To merge this branch: bzr merge lp:~gordallott/unity/unity.fix-814619
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+69275@code.launchpad.net

Description of the change

adds a check on null pointers in SetIconName
hopefully fixes lp:814619

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/SimpleLauncherIcon.cpp'
2--- plugins/unityshell/src/SimpleLauncherIcon.cpp 2011-07-21 14:59:25 +0000
3+++ plugins/unityshell/src/SimpleLauncherIcon.cpp 2011-07-26 12:58:06 +0000
4@@ -17,6 +17,7 @@
5 * Authored by: Jason Smith <jason.smith@canonical.com>
6 */
7
8+#include <NuxCore/Logger.h>
9 #include "Nux/Nux.h"
10 #include "Nux/BaseWindow.h"
11
12@@ -24,6 +25,11 @@
13 #include "Launcher.h"
14 #include "PluginAdapter.h"
15
16+namespace
17+{
18+ nux::logging::Logger logger("unity.dash.CategoryViewGrid");
19+}
20+
21 SimpleLauncherIcon::SimpleLauncherIcon(Launcher* IconManager)
22 : LauncherIcon(IconManager)
23 , icon_(0)
24@@ -96,7 +102,16 @@
25
26 void SimpleLauncherIcon::SetIconName(const char* name)
27 {
28- icon_name_ = name;
29+ if (name == NULL)
30+ {
31+ LOG_WARNING(logger) << "attempted to set NULL as IconName";
32+ icon_name_.clear();
33+ }
34+ else
35+ {
36+ icon_name_ = name;
37+ }
38+
39 ReloadIcon();
40 }
41