Safety check

This commit is contained in:
Tamius Han 2021-05-11 22:44:24 +02:00
parent b99929063c
commit e5c1bcded1

View File

@ -390,6 +390,12 @@ class VideoData {
// verify that mutation didn't remove our class. Some pages like to do that.
let confirmAspectRatioRestore = false;
if (!this.video) {
this.logger.log('error', 'debug', '[VideoData::onVideoMutation] mutation was triggered, but video element is missing. Something is fishy. Terminating this uw instance.');
this.destroy();
return;
}
for(const mutation of mutationList) {
if (mutation.type === 'attributes') {
if( mutation.attributeName === 'class'