From 195d7bd126facd379537c3672e79c6f96cc8f70b Mon Sep 17 00:00:00 2001 From: Alan Orozco Date: Thu, 14 May 2020 13:38:46 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20try/catch=20when=20pausing=20ani?= =?UTF-8?q?mations=20(#28423)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/amp-story/1.0/animation.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/amp-story/1.0/animation.js b/extensions/amp-story/1.0/animation.js index 02435c0490cf..0a59f97ca0b4 100644 --- a/extensions/amp-story/1.0/animation.js +++ b/extensions/amp-story/1.0/animation.js @@ -374,9 +374,12 @@ export class AnimationRunner { } if (this.runner_) { - // Init or no-op if the runner was already running. - this.runner_.start(); - this.runner_.pause(); + try { + this.runner_.pause(); + } catch { + // This fails when the animation is finished explicitly + // (runner.finish()) since this destroys internal players. This is fine. + } } }