Bug 449810 – legacy storage module should throw on canceled master password entry in getAllLogins. r=dolske

This commit is contained in:
Paul O'Shannessy 2008-08-08 16:04:27 -07:00
Родитель d40f4e90b5
Коммит 4c0050fc15
2 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -97,7 +97,11 @@ var signonsTreeView = {
function LoadSignons() {
// loads signons into table
signons = passwordmanager.getAllLogins({});
try {
signons = passwordmanager.getAllLogins({});
} catch (e) {
signons = [];
}
signonsTreeView.rowCount = signons.length;
// sort and display the table
@ -204,8 +208,13 @@ function FinalizeSignonDeletions(syncNeeded) {
}
// If the deletion has been performed in a filtered view, reflect the deletion in the unfiltered table.
// See bug 405389.
if (syncNeeded)
signons = passwordmanager.getAllLogins({});
if (syncNeeded) {
try {
signons = passwordmanager.getAllLogins({});
} catch (e) {
signons = [];
}
}
deletedSignons.length = 0;
}

Просмотреть файл

@ -316,6 +316,9 @@ LoginManagerStorage_legacy.prototype = {
// decrypt entries for caller.
[result, userCanceled] = this._decryptLogins(result);
if (userCanceled)
throw "User canceled Master Password entry";
count.value = result.length; // needed for XPCOM
return result;
},