diff --git a/src/handler/preprocess.ts b/src/handler/preprocess.ts index d7f18b9d..857efc70 100644 --- a/src/handler/preprocess.ts +++ b/src/handler/preprocess.ts @@ -123,7 +123,7 @@ function translateSVGNodeToSVGString( } if (k === 'href' && type === 'image') { - return ` ${ATTRIBUTE_MAPPING[k] || k}="${cache.get(_v as string)[0]}"` + return ` ${ATTRIBUTE_MAPPING[k] || k}="${cache.get(_v as string)?.[0]}"` } return ` ${ATTRIBUTE_MAPPING[k] || k}="${_v}"` })