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

This commit is contained in:
李通洲 authored and Carter Li committed 2025-01-02 16:35:53 +08:00
1 parent 89e4403cc8
commit f373e07847
1 file changed
+4
+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;
}