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
This commit is contained in:
Xiaoguang Wang 2017-09-20 09:05:16 +08:00 committed by Florian Müllner
parent 0932324d39
commit 594cc7cbef

View File

@ -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;