зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1253891 - "prefStrBundle.getFormattedString is not a function" exceptions in in-content/advanced.js. r=gijs
Guards were added to both async calls as it is likely that either of them could fire after the tab has been closed. MozReview-Commit-ID: 9pKKNKXtxaP
This commit is contained in:
Родитель
05225c81fc
Коммит
64075b6fc0
|
@ -357,6 +357,11 @@ var gAdvancedPane = {
|
|||
this.observer = {
|
||||
onNetworkCacheDiskConsumption: function(consumption) {
|
||||
var size = DownloadUtils.convertByteUnits(consumption);
|
||||
// The XBL binding for the string bundle may have been destroyed if
|
||||
// the page was closed before this callback was executed.
|
||||
if (!prefStrBundle.getFormattedString) {
|
||||
return;
|
||||
}
|
||||
actualSizeLabel.value = prefStrBundle.getFormattedString("actualDiskCacheSize", size);
|
||||
},
|
||||
|
||||
|
@ -385,6 +390,11 @@ var gAdvancedPane = {
|
|||
var actualSizeLabel = document.getElementById("actualAppCacheSize");
|
||||
var sizeStrings = DownloadUtils.convertByteUnits(aConsumption);
|
||||
var prefStrBundle = document.getElementById("bundlePreferences");
|
||||
// The XBL binding for the string bundle may have been destroyed if
|
||||
// the page was closed before this callback was executed.
|
||||
if (!prefStrBundle.getFormattedString) {
|
||||
return;
|
||||
}
|
||||
var sizeStr = prefStrBundle.getFormattedString("actualAppCacheSize", sizeStrings);
|
||||
actualSizeLabel.value = sizeStr;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче