Merge lp:~victored/wingpanel/lp-1170998 into lp:~elementary-pantheon/wingpanel/old-trunk

Proposed by Victor Martinez
Status: Merged
Merged at revision: 133
Proposed branch: lp:~victored/wingpanel/lp-1170998
Merge into: lp:~elementary-pantheon/wingpanel/old-trunk
Diff against target: 32 lines (+4/-4)
1 file modified
src/Indicator/IndicatorObjectEntry.vala (+4/-4)
To merge this branch: bzr merge lp:~victored/wingpanel/lp-1170998
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+162293@code.launchpad.net

Commit message

Don't assume that all the indicators return a valid entry name.

Some indicators do not set a value for the "entry-name" property, and we need to avoid dereferencing a null pointer in such case. Fixes lp:1170998.

Description of the change

To post a comment you must log in.
lp:~victored/wingpanel/lp-1170998 updated
133. By Victor Martinez

Some indicators do not set a value for the "entry-name" property, and we need to avoid dereferencing a null pointer in such case. This fixes bug #1170998.

Revision history for this message
Cody Garver (codygarver) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Indicator/IndicatorObjectEntry.vala'
2--- src/Indicator/IndicatorObjectEntry.vala 2013-04-14 07:54:25 +0000
3+++ src/Indicator/IndicatorObjectEntry.vala 2013-05-03 03:48:29 +0000
4@@ -50,9 +50,6 @@
5 this.entry = entry;
6 this.indicator = indicator;
7
8- string indicator_name = indicator.get_name ();
9- string entry_name = get_entry_name ();
10-
11 var image = entry.image;
12 if (image != null && image is Gtk.Image)
13 set_widget (WidgetSlot.IMAGE, image);
14@@ -64,6 +61,9 @@
15 show ();
16
17 if (entry.menu == null) {
18+ string indicator_name = indicator.get_name ();
19+ string entry_name = get_entry_name ();
20+
21 critical ("Indicator: %s (%s) has no menu widget.", indicator_name, entry_name);
22 return;
23 }
24@@ -78,7 +78,7 @@
25 }
26
27 public string get_entry_name () {
28- return entry.name_hint;
29+ return entry.name_hint ?? "";
30 }
31
32 private void setup_drawing () {

Subscribers

People subscribed via source and target branches

to all changes: