Skip to content

Commit 98beb6d

Browse files
authored
Check length before assigning to a return tag (#606)
1 parent 29cd58b commit 98beb6d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/infer/return.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = function () {
3232
fn.returnType &&
3333
fn.returnType.typeAnnotation) {
3434
var returnType = flowDoctrine(fn.returnType.typeAnnotation);
35-
if (comment.returns) {
35+
if (comment.returns && comment.returns.length > 0) {
3636
comment.returns[0].type = returnType;
3737
} else {
3838
comment.returns = [{

0 commit comments

Comments
 (0)