From bdf7cb7dba35f6387c7c714c556f707c33f786e6 Mon Sep 17 00:00:00 2001 From: the1812 Date: Mon, 12 Feb 2024 23:28:09 +0800 Subject: [PATCH] Fix empty content (fix #4629) --- src/components/video/xml-utils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/video/xml-utils.ts b/src/components/video/xml-utils.ts index 9b5faceae..713f9d178 100644 --- a/src/components/video/xml-utils.ts +++ b/src/components/video/xml-utils.ts @@ -7,6 +7,9 @@ const normalizeMap = { } const escapeMap = Object.fromEntries(Object.entries(normalizeMap).map(entry => entry.reverse())) const replace = (content: string, map: Record) => { + if (!content) { + return '' + } for (const [key, value] of Object.entries(map)) { content = content.replace(new RegExp(key, 'g'), value) }