Skip to content

Commit bf212b8

Browse files
authored
Merge pull request #303 from SimplyY/patch-1
fix: fix when initializer is undefined
2 parents 693f14b + d61c4d2 commit bf212b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/parser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,9 @@ export class Parser {
793793

794794
const defaultProps = possibleDefaultProps[0];
795795
let initializer = (defaultProps as ts.PropertyDeclaration).initializer;
796+
if (!initializer) {
797+
return res;
798+
}
796799
let properties = (initializer as ts.ObjectLiteralExpression).properties;
797800

798801
while (ts.isIdentifier(initializer as ts.Identifier)) {

0 commit comments

Comments
 (0)