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

Unified Diff: Source/core/animation/ElementAnimation.h

Issue 423763002: Animations: Fix bug where getAnimationPlayers() crashes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « LayoutTests/web-animations-api/w3c/getAnimationPlayers.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/ElementAnimation.h
diff --git a/Source/core/animation/ElementAnimation.h b/Source/core/animation/ElementAnimation.h
index 63bef0af56830929d920f21163a1e58c67b4952c..a083423cedf912cfaf68eb91ac648edb3dbdf1e4 100644
--- a/Source/core/animation/ElementAnimation.h
+++ b/Source/core/animation/ElementAnimation.h
@@ -91,7 +91,11 @@ public:
static WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > getAnimationPlayers(Element& element)
{
- WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > animationPlayers = WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> >();
+ WillBeHeapVector<RefPtrWillBeMember<AnimationPlayer> > animationPlayers;
+
+ if (!element.hasActiveAnimations())
+ return animationPlayers;
+
const AnimationPlayerCountedSet& players = element.activeAnimations()->players();
for (AnimationPlayerCountedSet::const_iterator it = players.begin(); it != players.end(); ++it) {
« no previous file with comments | « LayoutTests/web-animations-api/w3c/getAnimationPlayers.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698