зеркало из https://github.com/mozilla/pjs.git
bug 245813 patch by Mike Calmus mcalmus@nyx.net r=timeless sr=dveditz
This patch allows the code to propagate more specific failure reasons to the top layer so the exception can deal with different situations as apporpriate.
This commit is contained in:
Родитель
4b7cdb04f4
Коммит
81857b804a
|
@ -288,7 +288,12 @@ function LoadSignons() {
|
|||
|
||||
signons[count] = new Signon(count++, host, user, rawuser, password);
|
||||
} catch(e) {
|
||||
/* An entry is corrupt. Go to next element. */
|
||||
/* The user cancelled the master password dialog */
|
||||
if (e.result==Components.results.NS_ERROR_NOT_AVAILABLE) {
|
||||
window.close();
|
||||
return false;
|
||||
}
|
||||
/* Otherwise an entry is corrupt. Go to next element. */
|
||||
}
|
||||
}
|
||||
signonsTreeView.rowCount = signons.length;
|
||||
|
|
|
@ -3034,9 +3034,10 @@ SINGSIGN_Enumerate
|
|||
}
|
||||
|
||||
nsAutoString userName;
|
||||
if (NS_FAILED(si_Decrypt(data->value, userName))) {
|
||||
nsresult rv = si_Decrypt(data->value, userName);
|
||||
if (NS_FAILED(rv)) {
|
||||
/* don't display saved signons if user couldn't unlock the database */
|
||||
return NS_ERROR_FAILURE;
|
||||
return rv;
|
||||
}
|
||||
if (!(*user = ToNewUnicode(userName))) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -3051,10 +3052,11 @@ SINGSIGN_Enumerate
|
|||
}
|
||||
|
||||
nsAutoString passWord;
|
||||
if (NS_FAILED(si_Decrypt(data->value, passWord))) {
|
||||
rv = si_Decrypt(data->value, passWord);
|
||||
if (NS_FAILED(rv)) {
|
||||
/* don't display saved signons if user couldn't unlock the database */
|
||||
Recycle(*user);
|
||||
return NS_ERROR_FAILURE;
|
||||
return rv;
|
||||
}
|
||||
if (!(*pswd = ToNewUnicode(passWord))) {
|
||||
Recycle(*user);
|
||||
|
|
Загрузка…
Ссылка в новой задаче