Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp

Issue 1965693002: Fix null crash when creating KeyframeEffects with null targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/keyframe-effect-null-target-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
index 4f001bcf8c8b18f03b48da622c917912d0ac9116..cf5adcc5da02858f349eb4d5d1733c284b73012d 100644
--- a/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
+++ b/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
@@ -70,7 +70,8 @@ KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
if (element)
UseCounter::count(element->document(), UseCounter::AnimationConstructorKeyframeListEffectObjectTiming);
Timing timing;
- if (!TimingInput::convert(timingInput, timing, &element->document(), exceptionState))
+ Document* document = element ? &element->document() : nullptr;
+ if (!TimingInput::convert(timingInput, timing, document, exceptionState))
return nullptr;
return create(element, EffectInput::convert(element, effectInput, executionContext, exceptionState), timing);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/keyframe-effect-null-target-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698