shell_dbus_acquire_name: Don't assume error is set

In rare cases (mostly when the bus connection is going away),
g_dbus_proxy_call_sync can return NULL without setting an error.
Don't crash in this case.
This commit is contained in:
Matthias Clasen 2015-09-24 13:15:16 -04:00
parent 35b38d5cb2
commit 0bbb226faf

View File

@ -68,7 +68,7 @@ shell_dbus_acquire_name (GDBusProxy *bus,
NULL, /* cancellable */
&error)))
{
g_printerr ("failed to acquire %s: %s\n", name, error->message);
g_printerr ("failed to acquire %s: %s\n", name, error ? error->message : "");
if (!fatal)
return;
exit (1);