summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gorse <mgorse@suse.com>2017-05-08 18:59:40 -0500
committerMike Gorse <mgorse@suse.com>2017-05-08 19:10:27 -0500
commitf2932260e88fd8289a71035d5d2baf57086efcef (patch)
treeea924adee8f9f1d02b393ba9f0eae7a61178631f
parente2e67483240533643d19e2b1604ebcb9ec12f0ee (diff)
downloadat-spi2-core-f2932260e88fd8289a71035d5d2baf57086efcef.tar.gz
atspi_accessible_get_parent: move check for NULL AtspiApplication object
Now, if we don't have a cached parent, then we always either return NULL or make a D-Bus call. This might make the code more robust, and hoping that it will fix https://bugzilla.gnome.org/show_bug.cgi?id=767074, though in theory it should make no difference there.
-rw-r--r--atspi/atspi-accessible.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 4547ef7f..b84317f3 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -268,11 +268,12 @@ atspi_accessible_get_parent (AtspiAccessible *obj, GError **error)
{
g_return_val_if_fail (obj != NULL, NULL);
- if (obj->parent.app &&
- !_atspi_accessible_test_cache (obj, ATSPI_CACHE_PARENT))
+ if (!_atspi_accessible_test_cache (obj, ATSPI_CACHE_PARENT))
{
DBusMessage *message, *reply;
DBusMessageIter iter, iter_variant;
+ if (!obj->parent.app)
+ return NULL;
message = dbus_message_new_method_call (obj->parent.app->bus_name,
obj->parent.path,
DBUS_INTERFACE_PROPERTIES, "Get");