It's possible for windows to open before TestPilotSetup is defined - don't barf in this case.
authorJono X <jono@mozilla.com>
Fri, 27 Aug 2010 18:32:09 -0700
changeset 496 fda55f782ff556fa4de3924be02f6cf7d89b5f75
parent 495 62e26c351704ccdd1a3a802925ce872d32c2be44
child 497 2ecd600d2f0e9fea11db00ddc887f25399a54b8c
push id413
push userjdicarlo@mozilla.com
push dateSat, 28 Aug 2010 01:32:12 +0000
It's possible for windows to open before TestPilotSetup is defined - don't barf in this case.
extension/content/browser.js
--- 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);