Bug 650161 - Allow for the possibility that the wrapper cache hasn't been initialized yet when updating it r=bz
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -118,18 +118,20 @@ public:
/**
* Update the wrapper if the object it contains is moved.
*
* This method must be called from the objectMovedOp class extension hook for
* any wrapper cached object.
*/
void UpdateWrapper(JSObject* aNewObject, const JSObject* aOldObject)
{
- MOZ_ASSERT(mWrapper == aOldObject);
- mWrapper = aNewObject;
+ if (mWrapper) {
+ MOZ_ASSERT(mWrapper == aOldObject);
+ mWrapper = aNewObject;
+ }
}
bool PreservingWrapper()
{
return HasWrapperFlag(WRAPPER_BIT_PRESERVED);
}
void SetIsDOMBinding()