From f373e07847b11e2f59954d8a02b62c68873464be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 2 Jan 2025 10:54:44 +0800 Subject: [PATCH] WM (Linux): don't crash if no wm is detected --- src/detection/wm/wm_linux.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/detection/wm/wm_linux.c b/src/detection/wm/wm_linux.c index c5d95dc75..821ee7973 100644 --- a/src/detection/wm/wm_linux.c +++ b/src/detection/wm/wm_linux.c @@ -22,9 +22,13 @@ static void getHyprland(FFstrbuf* result, FF_MAYBE_UNUSED FFWMOptions* options) const char* ffDetectWMVersion(const FFstrbuf* wmName, FFstrbuf* result, FFWMOptions* options) { + if (!wmName) + return "No WM detected"; + if (ffStrbufEqualS(wmName, FF_WM_PRETTY_HYPRLAND)) getHyprland(result, options); else return "Unsupported WM"; + return NULL; }