From 594cc7cbef4f8ee57b316b98e86e1a82a5074904 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wang Date: Wed, 20 Sep 2017 09:05:16 +0800 Subject: [PATCH] workspaceThumbnails: Avoid access to undefined variables If thumbnails haven't been created, they don't need to be destroyed. https://bugzilla.gnome.org/show_bug.cgi?id=787871 --- js/ui/workspaceThumbnail.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index c1b4bddc6..1ecdd92cc 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -884,6 +884,9 @@ var ThumbnailsBox = new Lang.Class({ }, _destroyThumbnails() { + if (this._thumbnails.length == 0) + return; + if (this._switchWorkspaceNotifyId > 0) { global.window_manager.disconnect(this._switchWorkspaceNotifyId); this._switchWorkspaceNotifyId = 0;