[at-spi2-core] _atspi-dbus_call_partial: Check for error.



commit 1495d5f9a35efdb81ac90e9186784d13c4c9188e
Author: Mike Gorse <mgorse suse com>
Date:   Mon Jan 14 13:03:52 2013 -0600

    _atspi-dbus_call_partial: Check for error.
    
    Dbind may return a message containing an error, so check for this in
    _atspi_dbus_call_partial. I an error is set, then do not return the
    message, but set the GError. This fixes some warnings where the error
    message was being passed to _atspi_dbus_return_accessible_from_message.

 atspi/atspi-misc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 8e85361..e4ef09f 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -1173,6 +1173,17 @@ out:
     /* TODO: Set gerror */
     dbus_error_free (&err);
   }
+
+  if (dbus_message_get_type (reply) == DBUS_MESSAGE_TYPE_ERROR)
+  {
+    const char *err_str = NULL;
+    dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &err_str, DBUS_TYPE_INVALID);
+    if (err_str)
+      g_set_error_literal (error, ATSPI_ERROR, ATSPI_ERROR_IPC, err_str);
+    dbus_message_unref (reply);
+    return NULL;
+  }
+
   return reply;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]