зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1429490 - Since nsISerializationHelper.serializeToString may throw, catch the error to prevent loss of session data. r=ckerschb
MozReview-Commit-ID: GOAFT4CpVrR --HG-- extra : rebase_source : 8885fc2c4dec92482ede4889fe4b0e26ca41baab
This commit is contained in:
Родитель
2b0630b677
Коммит
ce89269d22
|
@ -119,10 +119,17 @@ this.Utils = Object.freeze({
|
|||
* @return {String} The base64 encoded principal data.
|
||||
*/
|
||||
serializePrincipal(principal) {
|
||||
if (!principal)
|
||||
return null;
|
||||
let serializedPrincipal = null;
|
||||
|
||||
return serializationHelper.serializeToString(principal);
|
||||
try {
|
||||
if (principal) {
|
||||
serializedPrincipal = serializationHelper.serializeToString(principal);
|
||||
}
|
||||
} catch (e) {
|
||||
debug(`Failed to serialize principal '${principal}' ${e}`);
|
||||
}
|
||||
|
||||
return serializedPrincipal;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче