From 24f3a981b658d834d4ffe169bb5c8ca484731edd Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 27 Nov 2024 18:27:00 +0100 Subject: [PATCH] Issue #2255 - Follow-up: Check if we actually have a non-null global object. This should avoid the intermittent crashes that are still being reported on this issue that end up crashing because of a proxied object that can't be unwrapped after being passed around. --- dom/performance/Performance.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 6803219985..fd0eda0112 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -490,6 +490,11 @@ Performance::Measure(JSContext* aCx, const Optional& aEndMark, ErrorResult& aRv) { + if (!GetParentObject()) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return nullptr; + } + // Don't add the entry if the buffer is full. XXX should be removed by bug // 1159003. if (mUserEntries.Length() >= mResourceTimingBufferSize) {