[gnome-shell] workspaceThumbnails: Avoid access to undefined variables



commit 594cc7cbef4f8ee57b316b98e86e1a82a5074904
Author: Xiaoguang Wang <xwang suse com>
Date:   Wed Sep 20 09:05:16 2017 +0800

    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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]