From a0760a80b99e31ed9b721f4456d30449ed5ff870 Mon Sep 17 00:00:00 2001 From: RedBearAK <64876997+RedBearAK@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:31:31 -0800 Subject: [PATCH] Avoid NoneType error with unknown DEs --- lib/env.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/env.py b/lib/env.py index bfa06f7..c55aee4 100644 --- a/lib/env.py +++ b/lib/env.py @@ -227,7 +227,8 @@ def get_env_info(): error("ERROR: Desktop Environment not found in XDG_SESSION_DESKTOP or XDG_CURRENT_DESKTOP.") error("ERROR: Config file will not be able to adapt automatically to Desktop Environment.") - if 'unity' in _desktop_env.lower(): + # Protect '.lower()' method from NoneType error + if _desktop_env and 'unity' in _desktop_env.lower(): DESKTOP_ENV = 'unity' # Produce a simplified desktop environment name