aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-10-02 19:15:38 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-10-02 19:15:38 +0200
commitae13eca41e451c2516f9a534969b0c35fcf9e719 (patch)
tree0ffdbd06fef375ce76b4ac94d06e0e6701a46b3a
parent81ed3b837344a7423c8e7d676d161be56a386d09 (diff)
parent7a1769409539c7d672af51106d0fa186b32bd0ea (diff)
downloadayatana-indicator-messages-ae13eca41e451c2516f9a534969b0c35fcf9e719.tar.gz
ayatana-indicator-messages-ae13eca41e451c2516f9a534969b0c35fcf9e719.tar.bz2
ayatana-indicator-messages-ae13eca41e451c2516f9a534969b0c35fcf9e719.zip
Merge lp:~larsu/indicator-messages/lp1058386
Don't crash when getting an invalid desktop id.
-rw-r--r--libmessaging-menu/messaging-menu.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/libmessaging-menu/messaging-menu.c b/libmessaging-menu/messaging-menu.c
index 8a95b0a..3c5c6d4 100644
--- a/libmessaging-menu/messaging-menu.c
+++ b/libmessaging-menu/messaging-menu.c
@@ -148,7 +148,8 @@ messaging_menu_app_get_dbus_object_path (MessagingMenuApp *app)
{
gchar *path;
- g_return_val_if_fail (app->appinfo != NULL, NULL);
+ if (!app->appinfo)
+ return NULL;
path = g_strconcat ("/com/canonical/indicator/messages/",
g_app_info_get_id (G_APP_INFO (app->appinfo)),
@@ -170,6 +171,10 @@ export_menus_and_actions (GObject *source,
guint id;
gchar *object_path;
+ object_path = messaging_menu_app_get_dbus_object_path (app);
+ if (!object_path)
+ return;
+
bus = g_bus_get_finish (res, &error);
if (bus == NULL)
{
@@ -178,8 +183,6 @@ export_menus_and_actions (GObject *source,
return;
}
- object_path = messaging_menu_app_get_dbus_object_path (app);
-
id = g_dbus_connection_export_action_group (bus,
object_path,
G_ACTION_GROUP (app->source_actions),
@@ -479,6 +482,8 @@ messaging_menu_app_register (MessagingMenuApp *app)
return;
object_path = messaging_menu_app_get_dbus_object_path (app);
+ if (!object_path)
+ return;
indicator_messages_service_call_register_application (app->messages_service,
g_app_info_get_id (G_APP_INFO (app->appinfo)),
@@ -510,6 +515,9 @@ messaging_menu_app_unregister (MessagingMenuApp *app)
if (!app->messages_service)
return;
+ if (!app->appinfo)
+ return;
+
indicator_messages_service_call_unregister_application (app->messages_service,
g_app_info_get_id (G_APP_INFO (app->appinfo)),
app->cancellable,
@@ -546,6 +554,9 @@ messaging_menu_app_set_status (MessagingMenuApp *app,
if (!app->messages_service)
return;
+ if (!app->appinfo)
+ return;
+
indicator_messages_service_call_set_status (app->messages_service,
g_app_info_get_id (G_APP_INFO (app->appinfo)),
status_ids [status],