Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined (reading 'duration') #1559

Open
victordidenko opened this issue Dec 31, 2024 · 0 comments
Open

Cannot read properties of undefined (reading 'duration') #1559

victordidenko opened this issue Dec 31, 2024 · 0 comments

Comments

@victordidenko
Copy link

We have many errors in the Sentry, which looks like this

{
message: Cannot read properties of undefined (reading 'duration'),
name: TypeError,
stack: 
TypeError: Cannot read properties of undefined (reading 'duration')
    at Tf (.../player.js:188:3879)
    at CD.getExpiredTime (.../player.js:218:3581)
    at WD.stuckAtPlaylistEnd_ (.../player.js:218:45386)
    at kh.<anonymous> (.../player.js:218:37265)
    at i.dispatcher.i.dispatcher (.../player.js:23:40858)
    at Qh (.../player.js:23:41677)
    at kh.trigger (.../player.js:23:43393)
    at kh.haveMetadata (.../player.js:188:17321)
    at .../player.js:188:15997
    at Z_ (.../player.js:188:25260)
}

Unfortunately I cannot say conditions for this issue, I've never seen it in dev environment, but it is very frequent (in fact, this is the most repeating error in our Sentry), but from minified code I figured that this is sumDurations function:

durations += durationList[i].duration;

Image

Maybe it is possible to add some kind of a guard here, at least?
Like

durations += durationList[i]?.duration ?? 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant