Don't try to unref an object if atk returned NULL
[platform/core/uifw/at-spi2-atk.git] / atk-adaptor / adaptors / selection-adaptor.c
index 23b0a4f..b39b22d 100644 (file)
@@ -69,7 +69,8 @@ impl_GetSelectedChild (DBusConnection * bus, DBusMessage * message,
     }
   atk_object = atk_selection_ref_selection (selection, selectedChildIndex);
   reply = spi_object_return_reference (message, atk_object);
-  g_object_unref (atk_object);
+  if (atk_object)
+    g_object_unref (atk_object);
 
   return reply;
 }