Merge lp:~larsu/indicator-messages/lp1058386 into lp:indicator-messages/12.10

Proposed by Lars Karlitski
Status: Merged
Approved by: Lars Karlitski
Approved revision: 318
Merge reported by: Lars Karlitski
Merged at revision: not available
Proposed branch: lp:~larsu/indicator-messages/lp1058386
Merge into: lp:indicator-messages/12.10
Diff against target: 62 lines (+14/-3)
1 file modified
libmessaging-menu/messaging-menu.c (+14/-3)
To merge this branch: bzr merge lp:~larsu/indicator-messages/lp1058386
Reviewer Review Type Date Requested Status
jenkins (community) continuous-integration Needs Fixing
Charles Kerr (community) Approve
Review via email: mp+127308@code.launchpad.net

Description of the change

libmessaging-menu: don't crash when getting an invalid desktop id

Instead, silently don't export menus and actions. The single warning about the desktop id being invalid should be enough.

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) :
review: Approve
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libmessaging-menu/messaging-menu.c'
2--- libmessaging-menu/messaging-menu.c 2012-09-18 19:54:37 +0000
3+++ libmessaging-menu/messaging-menu.c 2012-10-01 15:35:24 +0000
4@@ -148,7 +148,8 @@
5 {
6 gchar *path;
7
8- g_return_val_if_fail (app->appinfo != NULL, NULL);
9+ if (!app->appinfo)
10+ return NULL;
11
12 path = g_strconcat ("/com/canonical/indicator/messages/",
13 g_app_info_get_id (G_APP_INFO (app->appinfo)),
14@@ -170,6 +171,10 @@
15 guint id;
16 gchar *object_path;
17
18+ object_path = messaging_menu_app_get_dbus_object_path (app);
19+ if (!object_path)
20+ return;
21+
22 bus = g_bus_get_finish (res, &error);
23 if (bus == NULL)
24 {
25@@ -178,8 +183,6 @@
26 return;
27 }
28
29- object_path = messaging_menu_app_get_dbus_object_path (app);
30-
31 id = g_dbus_connection_export_action_group (bus,
32 object_path,
33 G_ACTION_GROUP (app->source_actions),
34@@ -479,6 +482,8 @@
35 return;
36
37 object_path = messaging_menu_app_get_dbus_object_path (app);
38+ if (!object_path)
39+ return;
40
41 indicator_messages_service_call_register_application (app->messages_service,
42 g_app_info_get_id (G_APP_INFO (app->appinfo)),
43@@ -510,6 +515,9 @@
44 if (!app->messages_service)
45 return;
46
47+ if (!app->appinfo)
48+ return;
49+
50 indicator_messages_service_call_unregister_application (app->messages_service,
51 g_app_info_get_id (G_APP_INFO (app->appinfo)),
52 app->cancellable,
53@@ -546,6 +554,9 @@
54 if (!app->messages_service)
55 return;
56
57+ if (!app->appinfo)
58+ return;
59+
60 indicator_messages_service_call_set_status (app->messages_service,
61 g_app_info_get_id (G_APP_INFO (app->appinfo)),
62 status_ids [status],

Subscribers

People subscribed via source and target branches