diff --git a/src/lib/utils/parser.ts b/src/lib/utils/parser.ts index 2d0e366..2827440 100644 --- a/src/lib/utils/parser.ts +++ b/src/lib/utils/parser.ts @@ -10,6 +10,7 @@ export type ParseValue = { }; export function parseString(str: string, value: ParseValue) { + if (!str) return null; str = str.replace(/\{link\}/gi, value.link).replace(/\{raw_link\}/gi, value.raw_link); const re = /\{(?file|url|user)\.(?\w+)(::(?\w+))?\}/gi;