Skip to content

Commit

Permalink
check for undefined before reading property
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjektGopher committed Jul 14, 2022
1 parent 3929b4a commit dbef1ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/vue/src/client/docs/extractArgTypes.ts
Expand Up @@ -11,7 +11,7 @@ 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 && type.name !== 'enum';

if (!matched) return false;

Expand Down

0 comments on commit dbef1ab

Please sign in to comment.