From b25bafda0834f58acf50f472bfa0534f5714f30a Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 23 Jun 2022 18:52:05 +0200 Subject: [PATCH] guard null context in applyConfigToKeyboard --- src/managers/input/InputManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index fb4b50ef..79a13369 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -296,6 +296,12 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) { .options = OPTIONS.c_str()}; const auto CONTEXT = xkb_context_new(XKB_CONTEXT_NO_FLAGS); + + if (!CONTEXT) { + Debug::log(ERR, "applyConfigToKeyboard: CONTEXT null??"); + return; + } + const auto KEYMAP = xkb_keymap_new_from_names(CONTEXT, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); if (!KEYMAP) {