mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
Merge pull request #76854 from CapitaineCookie/fix-change-type
Fix crash when changing node type from PopupMenu to ItemList
This commit is contained in:
commit
6a1d3198d1
@ -2051,8 +2051,13 @@ bool PopupMenu::_get(const StringName &p_name, Variant &r_ret) const {
|
|||||||
r_ret = get_item_icon(item_index);
|
r_ret = get_item_icon(item_index);
|
||||||
return true;
|
return true;
|
||||||
} else if (property == "checkable") {
|
} else if (property == "checkable") {
|
||||||
r_ret = this->items[item_index].checkable_type;
|
if (item_index >= 0 && item_index < items.size()) {
|
||||||
return true;
|
r_ret = items[item_index].checkable_type;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
r_ret = Item::CHECKABLE_TYPE_NONE;
|
||||||
|
ERR_FAIL_V(true);
|
||||||
|
}
|
||||||
} else if (property == "checked") {
|
} else if (property == "checked") {
|
||||||
r_ret = is_item_checked(item_index);
|
r_ret = is_item_checked(item_index);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user