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) {