Merge lp:~charlesk/indicator-session/lp-1061844 into lp:indicator-session/12.10

Proposed by Charles Kerr on 2012-10-10
Status: Merged
Approved by: Ted Gould on 2012-10-10
Approved revision: 367
Merged at revision: 367
Proposed branch: lp:~charlesk/indicator-session/lp-1061844
Merge into: lp:indicator-session/12.10
Diff against target: 46 lines (+19/-15)
1 file modified
src/session-menu-mgr.c (+19/-15)
To merge this branch: bzr merge lp:~charlesk/indicator-session/lp-1061844
Reviewer Review Type Date Requested Status
Ted Gould (community) 2012-10-10 Approve on 2012-10-10
jenkins (community) continuous-integration Approve on 2012-10-10
Review via email: mp+129002@code.launchpad.net

Commit message

Test upower_proxy for NULL before using it.

To post a comment you must log in.
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/session-menu-mgr.c'
2--- src/session-menu-mgr.c 2012-10-01 17:39:38 +0000
3+++ src/session-menu-mgr.c 2012-10-10 17:31:24 +0000
4@@ -247,23 +247,27 @@
5 static void
6 on_upower_properties_changed (SessionMenuMgr * mgr)
7 {
8- gboolean b;
9 gboolean need_refresh = FALSE;
10
11- /* suspend */
12- b = dbus_upower_get_can_suspend (mgr->upower_proxy);
13- if (mgr->can_suspend != b)
14- {
15- mgr->can_suspend = b;
16- need_refresh = TRUE;
17- }
18-
19- /* hibernate */
20- b = dbus_upower_get_can_hibernate (mgr->upower_proxy);
21- if (mgr->can_hibernate != b)
22- {
23- mgr->can_hibernate = b;
24- need_refresh = TRUE;
25+ if (mgr->upower_proxy != NULL)
26+ {
27+ gboolean b;
28+
29+ /* suspend */
30+ b = dbus_upower_get_can_suspend (mgr->upower_proxy);
31+ if (mgr->can_suspend != b)
32+ {
33+ mgr->can_suspend = b;
34+ need_refresh = TRUE;
35+ }
36+
37+ /* hibernate */
38+ b = dbus_upower_get_can_hibernate (mgr->upower_proxy);
39+ if (mgr->can_hibernate != b)
40+ {
41+ mgr->can_hibernate = b;
42+ need_refresh = TRUE;
43+ }
44 }
45
46 if (need_refresh)

Subscribers

People subscribed via source and target branches