Skip to content

Commit cb56fbf

Browse files
yyasinaslanmmalerba
authored andcommitted
fix(core): handle undefined CSS time values in parseCssTimeUnitsToMs function (#64181)
Improve error handling when `rawDelays` contains fewer items than `transitionedProperties`, preventing a toLowerCase of undefined error in `parseCssTimeUnitsToMs`. PR Close #64181
1 parent b22f73d commit cb56fbf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/animation/longest_animation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {LView} from '../render3/interfaces/view';
1010
import {LongestAnimation} from './interfaces';
1111

1212
/** Parses a CSS time value to milliseconds. */
13-
function parseCssTimeUnitsToMs(value: string): number {
13+
function parseCssTimeUnitsToMs(value: string | undefined): number {
14+
if (!value) return 0;
1415
// Some browsers will return it in seconds, whereas others will return milliseconds.
1516
const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000;
1617
return parseFloat(value) * multiplier;

0 commit comments

Comments
 (0)