From 593cc8a3684dfb163bfffa265c5efb3bc7efacd1 Mon Sep 17 00:00:00 2001 From: Jessica Janiuk Date: Wed, 23 Jul 2025 18:09:05 +0200 Subject: [PATCH] fix(core): checks if body exists before continuing (#62768) This fixes a case in which the document exists, but the body does not. PR Close #62768 --- packages/core/src/render3/instructions/animation.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/src/render3/instructions/animation.ts b/packages/core/src/render3/instructions/animation.ts index 13bed7b3388..90cfad290f0 100644 --- a/packages/core/src/render3/instructions/animation.ts +++ b/packages/core/src/render3/instructions/animation.ts @@ -32,6 +32,8 @@ const areAnimationSupported = (typeof ngServerMode === 'undefined' || !ngServerMode) && typeof document !== 'undefined' && // tslint:disable-next-line:no-toplevel-property-access + typeof document.body !== 'undefined' && + // tslint:disable-next-line:no-toplevel-property-access typeof document.body.getAnimations === 'function'; const noOpAnimationComplete = () => {};