From 44b6882a359844005ee8857aef715a4f8cb0707a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Exp=C3=B3sito?= Date: Fri, 23 Aug 2024 12:17:12 +0200 Subject: [PATCH] Check that XDG_SESSION_TYPE exists before using it Closes: https://github.com/JoseExposito/touche/issues/99 --- src/main-view/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main-view/index.js b/src/main-view/index.js index f1a26c0..2c755d8 100644 --- a/src/main-view/index.js +++ b/src/main-view/index.js @@ -64,7 +64,9 @@ class MainView extends Adw.Bin { } warnAboutWayland() { - if (GLib.getenv('XDG_SESSION_TYPE').toLowerCase() !== 'wayland') { + const sessionType = GLib.getenv('XDG_SESSION_TYPE'); + + if (!sessionType || sessionType.toLowerCase() !== 'wayland') { return; }