mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-15 20:54:59 +08:00
Fix call crashing because element was undefined
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
3e7aee3a87
commit
36607fa8a2
@ -80,7 +80,10 @@ export default class VideoFeed extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
private setElementRef = (element: HTMLVideoElement): void => {
|
||||
if (!element) element.removeEventListener('resize', this.onResize);
|
||||
if (!element) {
|
||||
this.element?.removeEventListener('resize', this.onResize);
|
||||
return;
|
||||
}
|
||||
|
||||
this.element = element;
|
||||
element.addEventListener('resize', this.onResize);
|
||||
|
Loading…
Reference in New Issue
Block a user