From 70a609bb3a7401b56377de77586e09a56d631468 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 19 Oct 2012 19:49:00 +0300 Subject: [PATCH] sap: Fix connected property fetching when not connected --- profiles/sap/server.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/profiles/sap/server.c b/profiles/sap/server.c index 530f99465..bb37c18e9 100644 --- a/profiles/sap/server.c +++ b/profiles/sap/server.c @@ -1295,11 +1295,15 @@ static gboolean server_property_get_connected( struct sap_connection *conn = server->conn; dbus_bool_t connected; - if (!conn) - return FALSE; + if (!conn) { + connected = FALSE; + goto append; + } connected = (conn->state == SAP_STATE_CONNECTED || conn->state == SAP_STATE_GRACEFUL_DISCONNECT); + +append: dbus_message_iter_append_basic(iter, DBUS_TYPE_BOOLEAN, &connected); return TRUE; -- 2.47.3