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:
parent
35b38d5cb2
commit
0bbb226faf
@ -68,7 +68,7 @@ shell_dbus_acquire_name (GDBusProxy *bus,
|
|||||||
NULL, /* cancellable */
|
NULL, /* cancellable */
|
||||||
&error)))
|
&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)
|
if (!fatal)
|
||||||
return;
|
return;
|
||||||
exit (1);
|
exit (1);
|
||||||
|
Loading…
Reference in New Issue
Block a user