dbus: return empty methods list in case no methods are found
authorImran Zaman <imran.zaman@linux.intel.com>
Fri, 17 May 2013 08:53:54 +0000 (11:53 +0300)
committerJussi Laako <jussi.laako@linux.intel.com>
Thu, 23 May 2013 10:50:33 +0000 (13:50 +0300)
src/daemon/dbus/gsignond-dbus-auth-service-adapter.c

index 2138933..1d70f0a 100644 (file)
@@ -410,12 +410,14 @@ _handle_query_methods (GSignondDbusAuthServiceAdapter   *self,
     
     methods = gsignond_daemon_query_methods (self->priv->auth_service, &error);
 
-    if (methods)
-        gsignond_dbus_auth_service_complete_query_methods (
-            self->priv->dbus_auth_service, invocation, (const gchar * const*)methods);
-    else {
+    if (error) {
         g_dbus_method_invocation_return_gerror (invocation, error);
         g_error_free (error);
+    } else {
+        const gchar *const empty_methods[] = { NULL };
+        gsignond_dbus_auth_service_complete_query_methods (
+              self->priv->dbus_auth_service, invocation,
+              methods ? (const gchar * const*)methods : empty_methods);
     }
 
     gsignond_disposable_set_keep_in_use (GSIGNOND_DISPOSABLE (self));