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.
This commit is contained in:
Jasper St. Pierre 2013-08-06 09:22:48 -04:00
parent 2ad9eafeaf
commit eec4334a78

View File

@ -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) {