Bug 622225: Don't die if window opens before TestPilotSetup is defined. r+a=dtownsend
authorJono S Xia <jdicarlo@mozilla.com>
Mon, 03 Jan 2011 11:59:00 -0800
changeset 59806 3a3d81c1c6365b06e80cf8f4ecc47aaccfe9a902
parent 59805 794627351d4e068feed419b5a11a4cc23e43ddb5
child 59807 6e25fd92573186d0462d0f434b7e255f30c43b6a
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
bugs622225
milestone2.0b9pre
Bug 622225: Don't die if window opens before TestPilotSetup is defined. r+a=dtownsend
browser/app/profile/extensions/testpilot@labs.mozilla.com/content/browser.js
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/browser.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/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);