diff --git a/dom/animation/AnimationEffectTiming.cpp b/dom/animation/AnimationEffectTiming.cpp index 1ecf6ce96540..afc1efb777d1 100644 --- a/dom/animation/AnimationEffectTiming.cpp +++ b/dom/animation/AnimationEffectTiming.cpp @@ -134,10 +134,14 @@ AnimationEffectTiming::SetEasing(JSContext* aCx, const nsAString& aEasing, ErrorResult& aRv) { + nsIDocument* document = AnimationUtils::GetCurrentRealmDocument(aCx); + if (!document) { + aRv.Throw(NS_ERROR_FAILURE); + return; + } + Maybe newFunction = - TimingParams::ParseEasing(aEasing, - AnimationUtils::GetCurrentRealmDocument(aCx), - aRv); + TimingParams::ParseEasing(aEasing, document, aRv); if (aRv.Failed()) { return; }