[gnome-shell-extensions/gnome-3-2] windowsNavigator: only access tooltip if it's known to exist



commit e6dd7e8155f29bbe3702a129348730b529c9c317
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Apr 26 22:50:11 2012 +0200

    windowsNavigator: only access tooltip if it's known to exist
    
    Apparently, windowOverlay._text can be null sometimes. In that
    case, do nothing instead of crashing.
    
    Cherry-picked from gnome-3-4

 extensions/windowsNavigator/extension.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js
index 3ec4abf..35188e3 100644
--- a/extensions/windowsNavigator/extension.js
+++ b/extensions/windowsNavigator/extension.js
@@ -34,7 +34,7 @@ function enable() {
     resetState();
 
     Workspace.WindowOverlay.prototype.setId = function(id) {
-        if (this._text.visible && id == null)
+        if (this._text && this._text.visible && id == null)
             this._text.hide();
         this._id = id;
         if (id != null)
@@ -57,7 +57,7 @@ function enable() {
     winInjections['showTooltip'] = undefined;
 
     Workspace.WindowOverlay.prototype.hideTooltip = function() {
-        if (this._text.visible)
+        if (this._text && this._text.visible)
             this._text.hide();
     }
     winInjections['hideTooltip'] = undefined;



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