diff options
author | Ted Gould <ted@canonical.com> | 2009-09-28 14:48:05 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-09-28 14:48:05 -0500 |
commit | c2a35dea3a5876a254206523122ee07112991e62 (patch) | |
tree | fa3a3cc25147915f7319d6def23e1e6b1caafe85 /src | |
parent | 8a31e1b09d93ea7468db7769e748f47995ea8a66 (diff) | |
download | ayatana-indicator-session-c2a35dea3a5876a254206523122ee07112991e62.tar.gz ayatana-indicator-session-c2a35dea3a5876a254206523122ee07112991e62.tar.bz2 ayatana-indicator-session-c2a35dea3a5876a254206523122ee07112991e62.zip |
Adding a check for null on the client in reorder and making it so that the inability to start a service is no longer an error. Just a critical.
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-session.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c index 8a4e298..13abb7d 100644 --- a/src/indicator-session.c +++ b/src/indicator-session.c @@ -138,6 +138,11 @@ child_realized (DbusmenuMenuitem * child, gpointer userdata) return; } + if (client == NULL) { + g_warning("Child realized for a menu we don't have? Section: %s", errorstr); + return; + } + position += posfunc(); g_debug("SUS: Adding child: %d", position); GtkMenuItem * widget = dbusmenu_gtkclient_menuitem_get(client, child); @@ -444,14 +449,16 @@ build_session_menu (gpointer userdata) return TRUE; } - if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_SESSION_DBUS_NAME, 0, &returnval, &error)) { - g_error("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" ); - g_error_free(error); + if (!org_freedesktop_DBus_start_service_by_name (proxy, INDICATOR_SESSION_DBUS_NAME, 0 /* Flags */, &returnval, &error)) { + g_critical("Unable to send message to DBus to start service: %s", error != NULL ? error->message : "(NULL error)" ); + if (error != NULL) { + g_error_free(error); + } return FALSE; } if (returnval != DBUS_START_REPLY_SUCCESS && returnval != DBUS_START_REPLY_ALREADY_RUNNING) { - g_error("Return value isn't indicative of success: %d", returnval); + g_critical("Return value isn't indicative of success: %d", returnval); return FALSE; } |