Skip to content

Commit

Permalink
fix: add check for empty args[1] (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Feb 4, 2022
1 parent 186f65b commit a86e62b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/transforms/directive/vue2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function resolveVue2(code: string, s: MagicString): Promise
for (const node of nodes) {
const { callee, arguments: args } = node
// _c(_, {})
if (callee.type !== 'Identifier' || callee.name !== '_c' || args[1].type !== 'ObjectExpression')
if (callee.type !== 'Identifier' || callee.name !== '_c' || args[1] == null || args[1].type !== 'ObjectExpression')
continue

// { directives: [] }
Expand Down

0 comments on commit a86e62b

Please sign in to comment.