Prevent passing null to g_hash_table_unref 54/246954/1 accepted/tizen/unified/20201116.220348 submit/tizen/20201108.215920 submit/tizen/20201115.212153
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Thu, 5 Nov 2020 09:39:36 +0000 (10:39 +0100)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Thu, 5 Nov 2020 09:41:36 +0000 (10:41 +0100)
This commit removes annoying message from glib2:

"GLib-CRITICAL g_hash_table_unref: assertion 'hash_table != NULL'
failed"

Change-Id: Idf9eaaebc03f0b0fe8c6275c625d902e3361343a

atspi/atspi-accessible.c

index 2cc4cb4..c743d1e 100644 (file)
@@ -1227,7 +1227,9 @@ atspi_accessible_get_attributes (AtspiAccessible *obj, GError **error)
   {
     message = _atspi_dbus_call_partial (obj, atspi_interface_accessible,
                                         "GetAttributes", error, "");
-    g_hash_table_unref(obj->attributes);
+    if (obj->attributes)
+        g_hash_table_unref(obj->attributes);
+
     obj->attributes = _atspi_dbus_return_hash_from_message (message);
     _atspi_accessible_add_cache (obj, ATSPI_CACHE_ATTRIBUTES);
   }