From 83909cd1fa03fdd5069e00ce556a5f1768a2adc9 Mon Sep 17 00:00:00 2001 From: hadi Date: Mon, 13 Nov 2023 13:26:18 +0100 Subject: [PATCH] Fix js error of Cannot read properties of null (reading '0') --- api/js/etemplate/CustomHtmlElements/multi-video.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/js/etemplate/CustomHtmlElements/multi-video.ts b/api/js/etemplate/CustomHtmlElements/multi-video.ts index 5e143a5655..f8fcf59fbd 100644 --- a/api/js/etemplate/CustomHtmlElements/multi-video.ts +++ b/api/js/etemplate/CustomHtmlElements/multi-video.ts @@ -145,7 +145,7 @@ class multi_video extends HTMLElement { { video = document.createElement('video'); // get duration from url duration param which is necessary for setting duration time of webm file - let params = new URLSearchParams(value[i].match(/\?.*/)[0]); + let params = new URLSearchParams(value[i].split('?')[1]||''); duration = parseInt(params.get('duration')||'0'); video.src = value[i]; this._videos[i] = {