WM (Linux): don't crash if no wm is detected

This commit is contained in:
李通洲
2025-01-02 10:54:44 +08:00
committed by Carter Li
parent 89e4403cc8
commit f373e07847
+4
View File
@@ -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;
}