Merge pull request #6488 from SimonBrandner/fix/call-crash/18270

This commit is contained in:
Michael Telatynski 2021-07-27 17:12:01 +01:00 committed by GitHub
commit e7151ebf2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,10 @@ export default class VideoFeed extends React.Component<IProps, IState> {
} }
private setElementRef = (element: HTMLVideoElement): void => { private setElementRef = (element: HTMLVideoElement): void => {
if (!element) element.removeEventListener('resize', this.onResize); if (!element) {
this.element?.removeEventListener('resize', this.onResize);
return;
}
this.element = element; this.element = element;
element.addEventListener('resize', this.onResize); element.addEventListener('resize', this.onResize);