mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 12:47:12 +01:00
Fix crash when pressing up on an empty PopupMenu
This commit is contained in:
parent
92bc8ed3be
commit
7fd1e3b8ac
@ -243,6 +243,7 @@ void PopupMenu::_scroll(float p_factor, const Point2 &p_over) {
|
||||
void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
|
||||
ERR_FAIL_COND(p_event.is_null());
|
||||
|
||||
if (!items.empty()) {
|
||||
if (p_event->is_action("ui_down") && p_event->is_pressed()) {
|
||||
int search_from = mouse_over + 1;
|
||||
if (search_from >= items.size()) {
|
||||
@ -332,6 +333,7 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
|
||||
accept_event();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ref<InputEventMouseButton> b = p_event;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user