Skip to content

Commit

Permalink
Check that XDG_SESSION_TYPE exists before using it
Browse files Browse the repository at this point in the history
Closes: #99
  • Loading branch information
JoseExposito committed Aug 23, 2024
1 parent 8ed42e7 commit 44b6882
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 44b6882

Please sign in to comment.