Skip to content

Commit 19dcd71

Browse files
committed
macOS: Fix a crash if no input event is set for a specific window
1 parent 209a446 commit 19dcd71

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

platform/macos/display_server_embedded.mm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@
426426

427427
void DisplayServerEmbedded::send_input_event(const Ref<InputEvent> &p_event, WindowID p_id) const {
428428
if (p_id != INVALID_WINDOW_ID) {
429-
_window_callback(input_event_callbacks[p_id], p_event);
429+
const Callable *cb = input_event_callbacks.getptr(p_id);
430+
if (cb) {
431+
_window_callback(*cb, p_event);
432+
}
430433
} else {
431434
for (const KeyValue<WindowID, Callable> &E : input_event_callbacks) {
432435
_window_callback(E.value, p_event);

0 commit comments

Comments
 (0)