From dee28c3fbfda2bf0326311d9afa253d1cdfe5aa7 Mon Sep 17 00:00:00 2001 From: Aleks Xhuvani <34059898+thehydrogen@users.noreply.github.com> Date: Thu, 9 Nov 2023 23:35:53 +0100 Subject: [PATCH] [Glitch] Do not try to update an undefined video element Port 7840c6b75b61e64d89d7fd9f291277fb177e513f to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/video/index.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/javascript/flavours/glitch/features/video/index.jsx b/app/javascript/flavours/glitch/features/video/index.jsx index a3050dfa6e..577ebc9ec3 100644 --- a/app/javascript/flavours/glitch/features/video/index.jsx +++ b/app/javascript/flavours/glitch/features/video/index.jsx @@ -441,6 +441,10 @@ class Video extends PureComponent { }; _syncVideoToVolumeState = (volume = null, muted = null) => { + if (!this.video) { + return; + } + this.video.volume = volume ?? this.state.volume; this.video.muted = muted ?? this.state.muted; };