diff --git a/src/hooks/web/useFormConfig.ts b/src/hooks/web/useFormConfig.ts index f0d5c65..e2346b1 100644 --- a/src/hooks/web/useFormConfig.ts +++ b/src/hooks/web/useFormConfig.ts @@ -117,7 +117,10 @@ export function useFormConfig() { async function queryConfig(formId:String,configName:String){ const formTemplate = await getFormTemplateUsingCache(formId); const renderConfig=formTemplate.renderConfig; - const exportMatches = renderConfig.matchAll(/export\s+const\s+(\w+)\s*(?::\s*\w+(?:\[\])?)?\s*=\s*([\s\S]*?)(?=\n\s*export\s+const|\n\s*const|\n\s*export\s+function|\n\s*function|$)/g); + if(renderConfig==null){ + return null; + } + const exportMatches = renderConfig.matchAll(/export\s+const\s+(\w+)\s*(?::\s*\w+(?:\[\])?)?\s*=\s*([\s\S]*?)(?=\n\s*export\s+const|\n\s*export\s+function|\n\s*function|$)/g); for (const match of exportMatches) { const varName = match[1]; const valueCode = match[2].trim();