Merge lp:~thumper/unity/fix-865840 into lp:unity

Proposed by Tim Penhey on 2012-01-24
Status: Merged
Approved by: Tim Penhey on 2012-01-25
Approved revision: 1859
Merged at revision: 1861
Proposed branch: lp:~thumper/unity/fix-865840
Merge into: lp:unity
Diff against target: 14 lines (+1/-3)
1 file modified
plugins/unityshell/src/BamfLauncherIcon.cpp (+1/-3)
To merge this branch: bzr merge lp:~thumper/unity/fix-865840
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve on 2012-01-24
Sam Spilsbury (community) 2012-01-24 Approve on 2012-01-24
Review via email: mp+89812@code.launchpad.net

Commit Message

Don't assign null to a std::string

Description of the Change

The bamf call could return null when a window doesn't have a name.

We should never assign null to a std::string.

Not sure how to best test this, as we can't reproduce the problem, and bamf doesn't yet have mocking or faking.

To post a comment you must log in.
Sam Spilsbury (smspillaz) :
review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

Yep, that was something I planned to do too.
Nice.

review: Approve
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/153/console reported an error when processing this lp:~thumper/unity/fix-865840 branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/BamfLauncherIcon.cpp'
2--- plugins/unityshell/src/BamfLauncherIcon.cpp 2012-01-15 19:01:11 +0000
3+++ plugins/unityshell/src/BamfLauncherIcon.cpp 2012-01-24 02:22:25 +0000
4@@ -323,9 +323,7 @@
5 view = static_cast <BamfView*> (l->data);
6 if (BAMF_IS_WINDOW(view) && (Window) bamf_window_get_xid(BAMF_WINDOW(view)) == window)
7 {
8- gchar *name = bamf_view_get_name (view);
9- result = name;
10- g_free (name);
11+ result = glib::String(bamf_view_get_name(view)).Str();
12 break;
13 }
14 }