From 0bbb226faf3866f43c9c89174e18740eb04b29d9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 24 Sep 2015 13:15:16 -0400 Subject: [PATCH] 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. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index d984eec26..f6d69e741 100644 --- a/src/main.c +++ b/src/main.c @@ -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);