Bug 797821 - Null check to fix intermittent orange. r=me
authorBobby Holley <bobbyholley@gmail.com>
Thu, 25 Oct 2012 18:36:45 +0200
changeset 111546 a09013468b3e29632d45edc4da0072f39e176767
parent 111545 6f9d1e6b22c0189e842b99855159f43493943cf1
child 111547 91698ac90375c09dd96e1bcf4bf78251156d9266
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersme
bugs797821
milestone19.0a1
Bug 797821 - Null check to fix intermittent orange. r=me
js/xpconnect/src/xpcprivate.h
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -2833,17 +2833,18 @@ public:
         }
         if (HasProto())
             GetProto()->TraceSelf(trc);
         else
             GetScope()->TraceSelf(trc);
         JSObject* wrapper = GetWrapperPreserveColor();
         if (wrapper)
             JS_CALL_OBJECT_TRACER(trc, wrapper, "XPCWrappedNative::mWrapper");
-        if (JS_IsGlobalObject(mFlatJSObject))
+        if (mFlatJSObject && mFlatJSObject != INVALID_OBJECT &&
+            JS_IsGlobalObject(mFlatJSObject))
         {
             TraceXPCGlobal(trc, mFlatJSObject);
         }
     }
 
     void TraceJS(JSTracer *trc) {
         TraceInside(trc);
     }