From eec4334a781684bf58f12eb88c598e5e3d21c26a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 6 Aug 2013 09:22:48 -0400 Subject: [PATCH] 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 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 151f70b4c..38ac63e7f 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) {