Check error of g_dbus_proxy_new_sync call

Otherwise errors pile up and we crash later on.
This commit is contained in:
Matthias Clasen 2015-09-24 13:31:07 -04:00
parent 3f0fbae7e2
commit 18c7138237

View File

@ -132,6 +132,12 @@ shell_dbus_init (gboolean replace)
NULL, /* cancellable */ NULL, /* cancellable */
&error); &error);
if (!bus)
{
g_printerr ("Failed to get a session bus proxy: %s", error->message);
exit (1);
}
request_name_flags = G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT; request_name_flags = G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT;
if (replace) if (replace)
request_name_flags |= DBUS_NAME_FLAG_REPLACE_EXISTING; request_name_flags |= DBUS_NAME_FLAG_REPLACE_EXISTING;