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 id17796
push userdtownsend@mozilla.com
push dateMon, 03 Jan 2011 23:58:04 +0000
treeherdermozilla-central@4294a3a4edf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs622225
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);