Bug 782877 - Intermittent browser_dbg_bfcache.js | uncaught JS exception - TypeError: element is undefined at debugger-controller.js:1275, r=rcampbell

This commit is contained in:
Victor Porof
2012-10-01 18:15:20 +03:00
parent bf1d2ff501
commit 3b98f00b58

View File

@@ -1353,6 +1353,16 @@ SourceScripts.prototype = {
_onLoadSourceFinished:
function SS__onLoadSourceFinished(aScriptUrl, aSourceText, aContentType, aOptions) {
let element = DebuggerView.Scripts.getScriptByLocation(aScriptUrl);
// Tab navigated before we got a chance to finish loading and displaying
// the source. The outcome is that the expected url is not present anymore
// in the scripts container, hence the original script object coming from
// the active thread no longer exists. There's really nothing that needs
// to be done in this case, nor something that can be currently avoided.
if (!element) {
return;
}
let script = element.getUserData("sourceScript");
script.loaded = true;