Bug 613480 - Check for a NULL docShell in browser constructor [r=gavin a=bsmedberg]
authorMark Finkle <mfinkle@mozilla.com>
Mon, 22 Nov 2010 16:37:35 -0500
changeset 58003 b5610f4fa3a8098a0c7f23e7db962cb2dcab694a
parent 58002 4273e6a3cd494a4557d6dab5fa77d44559144230
child 58004 372e38d12c5ef4c2af0f300b35d80f3dccf7b21d
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersgavin, bsmedberg
bugs613480
milestone2.0b8pre
Bug 613480 - Check for a NULL docShell in browser constructor [r=gavin a=bsmedberg]
toolkit/content/widgets/browser.xml
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -641,17 +641,18 @@
               var os = Components.classes["@mozilla.org/observer-service;1"]
                                  .getService(Components.interfaces.nsIObserverService);
               os.addObserver(this, "browser:purge-session-history", false);
               // wire up session history
               this.webNavigation.sessionHistory = 
                       Components.classes["@mozilla.org/browser/shistory;1"]
                                 .createInstance(Components.interfaces.nsISHistory);
               // enable global history
-              this.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;
+              if (this.docShell)
+                this.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;
             }
           }
           catch (e) {
             Components.utils.reportError(e);
           }
           try {
             var securityUI = this.securityUI;
           }