From b93bf2bd69a297e89f429fd8a71423105d43b7e9 Mon Sep 17 00:00:00 2001
From: Sebastian Keller <skeller@gnome.org>
Date: Fri, 23 Apr 2021 16:10:52 +0200
Subject: [PATCH] altTab: Avoid setting GObject property to undefined instead
 of null

The windowActor in the CyclerHighlight was set to undefined if
this._window was null. This was causing an error when trying to set it
as a property.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4167

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1820>
---
 js/ui/altTab.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/ui/altTab.js b/js/ui/altTab.js
index 3ecadad86..2ae7b6b23 100644
--- a/js/ui/altTab.js
+++ b/js/ui/altTab.js
@@ -427,7 +427,7 @@ class CyclerHighlight extends St.Widget {
         if (this._clone.source)
             this._clone.source.sync_visibility();
 
-        const windowActor = this._window?.get_compositor_private();
+        const windowActor = this._window?.get_compositor_private() ?? null;
 
         if (windowActor)
             windowActor.hide();