From 815302b4ac74e84e766c49efd1ec78c2731f5d44 Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Thu, 30 Nov 2017 20:53:39 +0000 Subject: [PATCH] altTab: Don't activate an app it the icon is no longer available https://bugzilla.gnome.org/show_bug.cgi?id=620106 --- js/ui/altTab.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/ui/altTab.js b/js/ui/altTab.js index c4eee7d7a..3a70c84a4 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -254,11 +254,12 @@ var AppSwitcherPopup = new Lang.Class({ _finish : function(timestamp) { let appIcon = this._items[this._selectedIndex]; - if (this._currentWindow < 0) - appIcon.app.activate_window(appIcon.cachedWindows[0], timestamp); - else if (appIcon.cachedWindows[this._currentWindow]) - Main.activateWindow(appIcon.cachedWindows[this._currentWindow], timestamp); - + if (appIcon) { + if (this._currentWindow < 0) + appIcon.app.activate_window(appIcon.cachedWindows[0], timestamp); + else if (appIcon.cachedWindows[this._currentWindow]) + Main.activateWindow(appIcon.cachedWindows[this._currentWindow], timestamp); + } this.parent(); },