Bug 827020 - Add null check to nsXULPrototypeDocument::TraceProtos. r=smaug
authorAndrew McCreight <amccreight@mozilla.com>
Sat, 05 Jan 2013 11:16:06 -0800
changeset 126703 16574882a15921ce4485db3ee84cd62b6f2839e3
parent 126702 6172df451c1c4e7bcbc00bcf35a861a707c94895
child 126704 d04f533e4d1e3d3895701ef6a91a82d39f24f897
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs827020
milestone20.0a1
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 827020 - Add null check to nsXULPrototypeDocument::TraceProtos. r=smaug
content/xul/document/src/nsXULPrototypeDocument.cpp
--- a/content/xul/document/src/nsXULPrototypeDocument.cpp
+++ b/content/xul/document/src/nsXULPrototypeDocument.cpp
@@ -683,17 +683,19 @@ void
 nsXULPrototypeDocument::TraceProtos(JSTracer* aTrc, uint32_t aGCNumber)
 {
   // Only trace the protos once per GC.
   if (mGCNumber == aGCNumber) {
     return;
   }
 
   mGCNumber = aGCNumber;
-  mRoot->TraceAllScripts(aTrc);
+  if (mRoot) {
+    mRoot->TraceAllScripts(aTrc);
+  }
 }
 
 //----------------------------------------------------------------------
 //
 // nsIScriptGlobalObjectOwner methods
 //
 
 nsIScriptGlobalObject*