From dea50cbf6aca6d22f6c56d1acc616a5f0e087b53 Mon Sep 17 00:00:00 2001 From: Pale Moon Date: Sun, 10 Jun 2018 01:53:05 +0200 Subject: Add a nullcheck in DOMProxyHandler::EnsureExpandoObject --- dom/bindings/DOMJSProxyHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dom') diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index f0ebf4385..e121ff65c 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -121,6 +121,10 @@ DOMProxyHandler::EnsureExpandoObject(JSContext* cx, JS::Handle obj) nsISupports* native = UnwrapDOMObject(obj); nsWrapperCache* cache; CallQueryInterface(native, &cache); + if (!cache) { + return expando; + } + if (expandoAndGeneration) { cache->PreserveWrapper(native); expandoAndGeneration->expando.setObject(*expando); -- cgit v1.2.3