From c951c4f8a1bf02e03c7efbe9a8887c1657ef95d3 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 4 May 2024 16:10:32 +0100 Subject: [PATCH] keyboard: check for wlr() validity before accessing fixes #5873 --- src/devices/IKeyboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/IKeyboard.cpp b/src/devices/IKeyboard.cpp index 790766bc..61b078fb 100644 --- a/src/devices/IKeyboard.cpp +++ b/src/devices/IKeyboard.cpp @@ -118,7 +118,7 @@ std::string IKeyboard::getActiveLayout() { void IKeyboard::updateLEDs() { auto keyboard = wlr(); - if (keyboard->xkb_state == nullptr) + if (!keyboard || keyboard->xkb_state == nullptr) return; uint32_t leds = 0;