It's possible for windows to open before TestPilotSetup is defined - don't barf in this case.
It's possible for windows to open before TestPilotSetup is defined - don't barf in this case.
--- a/extension/content/browser.js
+++ b/extension/content/browser.js
@@ -147,17 +147,17 @@ var TestPilotMenuUtils;
var TestPilotWindowHandlers = {
onWindowLoad: function() {
/* "Hold" window load events for TestPilotSetup, passing them along only
* after startup is complete. It's hacky, but the benefit is that
* TestPilotSetup.onWindowLoad can treat all windows the same no matter
* whether they opened with Firefox on startup or were opened later. */
TestPilotWindowHandlers.setUpToolbarFeedbackButton();
- if (TestPilotSetup.startupComplete) {
+ if (TestPilotSetup && TestPilotSetup.startupComplete) {
TestPilotSetup.onWindowLoad(window);
} else {
let observerSvc = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
let observer = {
observe: function(subject, topic, data) {
observerSvc.removeObserver(this, "testpilot:startup:complete");
TestPilotSetup.onWindowLoad(window);