Return state_set directly if there is no parent.

Bug #592403. Return state_set directly if there is no parent. Fix crash.
This commit is contained in:
Li Yuan 2009-08-21 15:29:51 +08:00
parent e0a1e78a5a
commit 0780a4975b

View File

@ -251,6 +251,8 @@ gail_menu_item_ref_state_set (AtkObject *obj)
menu_item = atk_object_get_parent (obj);
if (menu_item)
{
if (!GTK_IS_MENU_ITEM (GTK_ACCESSIBLE (menu_item)->widget))
return state_set;
@ -260,7 +262,7 @@ gail_menu_item_ref_state_set (AtkObject *obj)
atk_state_set_remove_state (state_set, ATK_STATE_FOCUSED);
atk_state_set_remove_state (state_set, ATK_STATE_SHOWING);
}
}
return state_set;
}