st-widget: Avoid passing NULL to atk_object_get_role()

This never worked since the code landed but apparently no-one noticed
until now.

The intent here is to return the accessible's default role if none has
been explicitly set on the StWidget instance.

https://bugzilla.gnome.org/show_bug.cgi?id=760945
This commit is contained in:
Rui Matos 2016-01-21 16:44:18 +01:00
parent b87da87252
commit c25c143b24

View File

@ -2420,7 +2420,6 @@ AtkRole
st_widget_get_accessible_role (StWidget *widget) st_widget_get_accessible_role (StWidget *widget)
{ {
StWidgetPrivate *priv; StWidgetPrivate *priv;
AtkObject *accessible = NULL;
AtkRole role = ATK_ROLE_INVALID; AtkRole role = ATK_ROLE_INVALID;
g_return_val_if_fail (ST_IS_WIDGET (widget), ATK_ROLE_INVALID); g_return_val_if_fail (ST_IS_WIDGET (widget), ATK_ROLE_INVALID);
@ -2430,7 +2429,7 @@ st_widget_get_accessible_role (StWidget *widget)
if (priv->accessible_role != ATK_ROLE_INVALID) if (priv->accessible_role != ATK_ROLE_INVALID)
role = priv->accessible_role; role = priv->accessible_role;
else if (priv->accessible != NULL) else if (priv->accessible != NULL)
role = atk_object_get_role (accessible); role = atk_object_get_role (priv->accessible);
return role; return role;
} }