diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index f93e60684ea..75224af6975 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -123,8 +123,10 @@ public: */ void UpdateWrapper(JSObject* aNewObject, const JSObject* aOldObject) { - MOZ_ASSERT(mWrapper == aOldObject); - mWrapper = aNewObject; + if (mWrapper) { + MOZ_ASSERT(mWrapper == aOldObject); + mWrapper = aNewObject; + } } bool PreservingWrapper()