summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-07 22:25:37 +0100
committerGitHub <noreply@github.com>2021-02-07 22:25:37 +0100
commit57e2822a05c29db3980ad243c37a34acf6c4d14b (patch)
treec77a904ffc6fa23ebbbed982a5400acb4da8f56a
parent57c03a432a66a587b46fc879875f7c06f8644cb1 (diff)
parentb6e2ad0e7e6bd41588b01b93c6cf89cd63cdca6d (diff)
Merge pull request #45805 from KoBeWi/dispatch_error_of_doom
Cancel event dispatch on error
-rw-r--r--platform/windows/display_server_windows.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 14e7d395d3..21dfc4ae2c 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -1784,7 +1784,10 @@ void DisplayServerWindows::_dispatch_input_event(const Ref<InputEvent> &p_event)
Ref<InputEventFromWindow> event_from_window = p_event;
if (event_from_window.is_valid() && event_from_window->get_window_id() != INVALID_WINDOW_ID) {
//send to a window
- ERR_FAIL_COND(!windows.has(event_from_window->get_window_id()));
+ if (!windows.has(event_from_window->get_window_id())) {
+ in_dispatch_input_event = false;
+ ERR_FAIL_MSG("DisplayServerWindows: Invalid window id in input event.");
+ }
Callable callable = windows[event_from_window->get_window_id()].input_event_callback;
if (callable.is_null()) {
in_dispatch_input_event = false;