Merge pull request #106367 from stuartcarnie/sgc_fix_embedded_crash

macOS: Fix a crash if no input event is set for a specific window
This commit is contained in:
Thaddeus Crews
2025-05-14 09:44:17 -05:00

View File

@@ -427,7 +427,10 @@ void DisplayServerEmbedded::_dispatch_input_events(const Ref<InputEvent> &p_even
void DisplayServerEmbedded::send_input_event(const Ref<InputEvent> &p_event, WindowID p_id) const {
if (p_id != INVALID_WINDOW_ID) {
_window_callback(input_event_callbacks[p_id], p_event);
const Callable *cb = input_event_callbacks.getptr(p_id);
if (cb) {
_window_callback(*cb, p_event);
}
} else {
for (const KeyValue<WindowID, Callable> &E : input_event_callbacks) {
_window_callback(E.value, p_event);