unlockDialog: Only cancel AuthPrompt if it exists

AuthPrompt is created on demand, and this._authPrompt is
expected to be null except on very strictly controlled
occasions. The idle monitor callback isn't one of them.

Check if AuthPrompt exists before cancelling it.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2371
This commit is contained in:
Georges Basile Stavracas Neto 2020-03-27 20:35:36 -03:00 committed by Florian Müllner
parent aafec16f49
commit bea34da289

View File

@ -761,7 +761,7 @@ var UnlockDialog = GObject.registerClass({
}
_escape() {
if (this.allowCancel)
if (this._authPrompt && this.allowCancel)
this._authPrompt.cancel();
}