Skip to content

Commit

Permalink
fix(codegen): getTypeAnnotationName safe access
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudpresser committed Jun 1, 2023
1 parent de688e5 commit 144fb4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-codegen/src/parsers/flow/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class FlowParser implements Parser {
}

getTypeAnnotationName(typeAnnotation: $FlowFixMe): string {
return typeAnnotation.id.name;
return typeAnnotation?.id?.name;
}

checkIfInvalidModule(typeArguments: $FlowFixMe): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class TypeScriptParser implements Parser {
}

getTypeAnnotationName(typeAnnotation: $FlowFixMe): string {
return typeAnnotation.typeName.name;
return typeAnnotation?.typeName?.name;
}

checkIfInvalidModule(typeArguments: $FlowFixMe): boolean {
Expand Down

0 comments on commit 144fb4f

Please sign in to comment.