2009-04-15 Mark Doffman <mark.doffman@codethink.co.uk>
[platform/core/uifw/at-spi2-atk.git] / droute / droute.c
index 23365ef..212c280 100644 (file)
@@ -479,7 +479,7 @@ handle_other (DBusConnection *bus,
 
     StrPair pair;
     DRouteFunction func;
-    DBusMessage *reply;
+    DBusMessage *reply = NULL;
 
     pair.one = iface;
     pair.two = member;
@@ -493,11 +493,16 @@ handle_other (DBusConnection *bus,
 
         reply = (func) (bus, message, datum);
 
-        if (reply)
+        if (!reply)
           {
-            dbus_connection_send (bus, reply, NULL);
-            dbus_message_unref (reply);
+            /* All D-Bus method calls must have a reply.
+             * If one is not provided presume that the call has a void
+             * return and no error has occured.
+             */
+            reply = dbus_message_new_method_return (message);
           }
+        dbus_connection_send (bus, reply, NULL);
+        dbus_message_unref (reply);
         result = DBUS_HANDLER_RESULT_HANDLED;
       }
     return result;