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

fix: check element for null in case of a disposed player #6701

Merged
merged 2 commits into from
Jul 15, 2021

Conversation

travisbader
Copy link
Contributor

@travisbader travisbader commented Jun 9, 2020

Description

#5706

Specific Changes proposed

Fail fast

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
    • Change has been verified in an actual browser (Chome, Firefox, IE)
    • Unit Tests updated or fixed
    • Docs/guides updated
    • Example created (starter template on JSBin)
  • Reviewed by Two Core Contributors

@stale
Copy link

stale bot commented Aug 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the outdated Things closed automatically by stalebot label Aug 16, 2020
@gkatsev gkatsev removed the outdated Things closed automatically by stalebot label Aug 18, 2020
@stale
Copy link

stale bot commented Oct 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the outdated Things closed automatically by stalebot label Oct 24, 2020
@gkatsev gkatsev removed the outdated Things closed automatically by stalebot label Oct 29, 2020
Copy link
Contributor

@brandonocasey brandonocasey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this in most of the functions in this file?

@gkatsev
Copy link
Member

gkatsev commented Nov 12, 2020

It's possible but generally they expose worse errors which are otherwise hidden by this null check.

@brandonocasey
Copy link
Contributor

I wonder if we should log a warning in this case then @gkatsev

Copy link
Member

@gkatsev gkatsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We spoke about it and while we still have reservations about it, if we add a log for this and do the null check we can merge it in.

src/js/utils/dom.js Show resolved Hide resolved
@DaveStein
Copy link

@brandonocasey @gkatsev does this address my errors like this?

Uncaught TypeError: Cannot read property 'parentNode' of null
Uncaught TypeError: Cannot read property 'language' of null
Uncaught TypeError: Cannot read property 'classList' of null
Uncaught TypeError: Cannot read property 'classList' of null
Uncaught TypeError: Cannot read property 'classList' of null

in minified code I had seen it as coming from this line, when on is fired for ready event

this.readyQueue_=[],e&&e.length>0&&e.forEach((function(e){e.call(this)}),this),this.trigger("ready")}),1)},t.$=function(e,t){return jt(e,t||this.contentEl())},t.$$=function(e,t){return Ft(e,t||this.contentEl())},

@gkatsev
Copy link
Member

gkatsev commented Nov 30, 2020

@DaveStein could be. Do you happen to have a live test page for this that you can share?

@DaveStein
Copy link

@gkatsev unfortunately i haven't reproduced this yet myself but just see it in error logs.

@gkatsev
Copy link
Member

gkatsev commented Dec 11, 2020

@DaveStein if you try latest main, we just merged a fix related to the readyQueue not being cleared out properly. We don't have a release out yet, but hopefully soon.

@DaveStein
Copy link

Thanks for the update @gkatsev. Since I haven't reproduced this locally, I'll need to wait for the release to be able to update my repo and deploy it. I imagine the worst case scenario for a release update is that my issue won't be fixed. If it does, I'll comment in this thread as well so future people searching Google for the error will see this PR fixes both issues.

@gkatsev
Copy link
Member

gkatsev commented Dec 15, 2020

Yes, once we get a release out, please circle back whether it's fixed or not.

@Szefczuk
Copy link

Hi, when are you planning to merge this pr?

@damjan25
Copy link

damjan25 commented Jul 14, 2021

Any plans to merge this in next release ? Or does it break something ?

@gkatsev gkatsev merged commit 85343d1 into videojs:master Jul 15, 2021
@welcome
Copy link

welcome bot commented Jul 15, 2021

Congrats on merging your first pull request! 🎉🎉🎉

edirub pushed a commit to edirub/video.js that referenced this pull request Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants