From c3a3a11db4b879903642cac5fb5136a2e90a0149 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 23 Mar 2025 16:48:16 -0500 Subject: [PATCH] keyboard: Don't check text input on a null window --- src/events/SDL_keyboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 066c6e6aaa..7f1ac7aaa1 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -747,7 +747,7 @@ void SDL_SendKeyboardText(const char *text) { SDL_Keyboard *keyboard = &SDL_keyboard; - if (!SDL_TextInputActive(keyboard->focus)) { + if (!keyboard->focus || !SDL_TextInputActive(keyboard->focus)) { return; } @@ -778,7 +778,7 @@ void SDL_SendEditingText(const char *text, int start, int length) { SDL_Keyboard *keyboard = &SDL_keyboard; - if (!SDL_TextInputActive(keyboard->focus)) { + if (!keyboard->focus || !SDL_TextInputActive(keyboard->focus)) { return; } @@ -838,7 +838,7 @@ void SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int se { SDL_Keyboard *keyboard = &SDL_keyboard; - if (!SDL_TextInputActive(keyboard->focus)) { + if (!keyboard->focus || !SDL_TextInputActive(keyboard->focus)) { return; }