From 7bafe3fd47799f4be0943f1ee1f16e89e7dadc19 Mon Sep 17 00:00:00 2001 From: Janghyub Seo Date: Mon, 8 Jan 2024 14:13:49 +0900 Subject: [PATCH] Fallback when XDG_CURRENT_DESKTOP & XDG_SESSION_TYPE is not defined --- src/tools/check/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/check/src/main.rs b/src/tools/check/src/main.rs index dad9d82f..9d4cbbbe 100644 --- a/src/tools/check/src/main.rs +++ b/src/tools/check/src/main.rs @@ -187,8 +187,8 @@ impl Check { "set LANG encoding UTF-8", ), Check::PlasmaVirtualKeyboard => { - let current_desktop = env::var("XDG_CURRENT_DESKTOP").unwrap(); - let session_type = env::var("XDG_SESSION_TYPE").unwrap(); + let current_desktop = env::var("XDG_CURRENT_DESKTOP").map_or(String::new(), |x| x); + let session_type = env::var("XDG_SESSION_TYPE").map_or(String::new(), |x| x); if current_desktop.contains("KDE") && session_type == "wayland" { let dirs = xdg::BaseDirectories::new().expect("Load xdg dirs"); let config_path = match dirs.find_config_file("kwinrc") {