Check for a NULL pending call before calling dbus_pending_call_set_notify
authorMike Gorse <mgorse@novell.com>
Mon, 3 Jan 2011 17:05:34 +0000 (11:05 -0600)
committerMike Gorse <mgorse@novell.com>
Mon, 3 Jan 2011 17:05:34 +0000 (11:05 -0600)
atk-adaptor/bridge.c
atk-adaptor/event.c

index 6a2ba15..6e74fcd 100644 (file)
@@ -303,7 +303,8 @@ register_application (SpiBridge * app)
   dbus_message_iter_init_append (message, &iter);
   spi_object_append_reference (&iter, app->root);
   
-    if (!dbus_connection_send_with_reply (app->bus, message, &pending, -1))
+    if (!dbus_connection_send_with_reply (app->bus, message, &pending, -1)
+        || !pending)
     {
         return FALSE;
     }
index 9e6e83e..63cb9a5 100644 (file)
@@ -88,7 +88,7 @@ send_and_allow_reentry (DBusConnection * bus, DBusMessage * message)
   closure.loop = g_main_loop_new (main_context, FALSE);
   switch_main_context (main_context);
 
-  if (!dbus_connection_send_with_reply (bus, message, &pending, -1))
+  if (!dbus_connection_send_with_reply (bus, message, &pending, -1) || !pending)
     {
       switch_main_context (NULL);
       return NULL;