mirror of
https://github.com/videojs/video.js.git
synced 2025-03-17 21:18:27 +02:00
fix(dom): in removeClass, check element for null in case of a disposed player (#6701)
This commit is contained in:
parent
9ef0c5ac44
commit
2990cc7d65
@ -282,6 +282,11 @@ export function addClass(element, classToAdd) {
|
||||
* The DOM element with class name removed.
|
||||
*/
|
||||
export function removeClass(element, classToRemove) {
|
||||
// Protect in case the player gets disposed
|
||||
if (!element) {
|
||||
log.warn("removeClass was called with an element that doesn't exist");
|
||||
return null;
|
||||
}
|
||||
if (element.classList) {
|
||||
element.classList.remove(classToRemove);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user