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
This commit is contained in:
Jessica Janiuk 2025-07-23 18:09:05 +02:00 committed by Kirill Cherkashin
parent a4a4f7f850
commit 593cc8a368

View file

@ -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 = () => {};