Skip to content

Commit 7a0412d

Browse files
committed
fixes vuejs#287:
check for key
1 parent 1643f7c commit 7a0412d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rules/require-default-prop.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ module.exports = {
4343
}
4444

4545
/**
46-
* Checks if the passed prop has a defualt value
46+
* Checks if the passed prop has a default value
4747
* @param {Property} prop - Property AST node for a single prop
4848
* @return {boolean}
4949
*/
5050
function propHasDefault (prop) {
5151
const propDefaultNode = prop.value.properties
52-
.find(p => p.key.name === 'default')
52+
.find(p => p.key && p.key.name === 'default')
5353

5454
return Boolean(propDefaultNode)
5555
}

0 commit comments

Comments
 (0)