diff --git a/browser/components/preferences/in-content/advanced.js b/browser/components/preferences/in-content/advanced.js index cfa42dc2dec0..87c8f61756a5 100644 --- a/browser/components/preferences/in-content/advanced.js +++ b/browser/components/preferences/in-content/advanced.js @@ -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; }