[gnome-shell] screenShield: Don't crash when trying to deactivate the shield



commit eec4334a781684bf58f12eb88c598e5e3d21c26a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Aug 6 09:22:48 2013 -0400

    screenShield: Don't crash when trying to deactivate the shield
    
    If the user has a lock delay, or deactivate() has been called at
    any other time, we need to check for the unlock dialog, as it may
    not always exist.

 js/ui/screenShield.js |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 151f70b..38ac63e 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -1123,9 +1123,12 @@ const ScreenShield = new Lang.Class({
     },
 
     deactivate: function(animate) {
-        this._dialog.finish(Lang.bind(this, function() {
+        if (this._dialog)
+            this._dialog.finish(Lang.bind(this, function() {
+                this._finishDeactivate(animate);
+            }));
+        else
             this._finishDeactivate(animate);
-        }));
     },
 
     _finishDeactivate: function(animate) {


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