Sfoglia il codice sorgente

Ensure input event is valid in `PopupMenu::activate_item_by_event`

A Thousand Ships 1 anno fa
parent
commit
f721b34b4e
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      scene/gui/popup_menu.cpp

+ 1 - 0
scene/gui/popup_menu.cpp

@@ -2186,6 +2186,7 @@ void PopupMenu::scroll_to_item(int p_idx) {
 }
 
 bool PopupMenu::activate_item_by_event(const Ref<InputEvent> &p_event, bool p_for_global_only) {
+	ERR_FAIL_COND_V(p_event.is_null(), false);
 	Key code = Key::NONE;
 	Ref<InputEventKey> k = p_event;