From 5c4ec40178aad8e89175c5ef599ace2f96060422 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Wed, 3 Aug 2022 17:15:15 +0200 Subject: [PATCH] Merge pull request #18710 from ProjektGopher/fix/vue-client-extractArgTypes [bugfix] Check for undefined before reading property in extractArgTypes.ts --- app/vue/src/client/docs/extractArgTypes.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/vue/src/client/docs/extractArgTypes.ts b/app/vue/src/client/docs/extractArgTypes.ts index 92a9f113e9c0..d2838be75cd9 100644 --- a/app/vue/src/client/docs/extractArgTypes.ts +++ b/app/vue/src/client/docs/extractArgTypes.ts @@ -11,9 +11,11 @@ const SECTIONS = ['props', 'events', 'slots', 'methods']; function isEnum(propDef: PropDef, docgenInfo: DocgenInfo): false | PropDef { // cast as any, since "values" doesn't exist in DocgenInfo type const { type, values } = docgenInfo as any; - const matched = Array.isArray(values) && values.length && type.name !== 'enum'; + const matched = Array.isArray(values) && values.length && type?.name !== 'enum'; - if (!matched) return false; + if (!matched) { + return false; + } const enumString = values.join(', '); let { summary } = propDef.type;