mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1631346 - Fix a null ptr crash in PerformanceObserver::Observe r=baku
Differential Revision: https://phabricator.services.mozilla.com/D76193
This commit is contained in:
parent
7ac7aeb879
commit
4b4bf8886f
@ -161,6 +161,11 @@ void PerformanceObserver::Observe(const PerformanceObserverInit& aOptions,
|
||||
const Optional<nsString>& maybeType = aOptions.mType;
|
||||
const Optional<bool>& maybeBuffered = aOptions.mBuffered;
|
||||
|
||||
if (!mPerformance) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!maybeEntryTypes.WasPassed() && !maybeType.WasPassed()) {
|
||||
/* Per spec (3.3.1.2), this should be a syntax error. */
|
||||
aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
|
||||
|
Loading…
Reference in New Issue
Block a user