From c2a35dea3a5876a254206523122ee07112991e62 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Sep 2009 14:48:05 -0500 Subject: 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. --- src/indicator-session.c | 15 +++++++++++---- 1 file 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; } -- cgit v1.2.3