Check length before assigning to a return tag (#606)

This commit is contained in:
Tom MacWright 2016-11-18 20:20:46 -05:00 committed by GitHub
parent 29cd58bb31
commit 98beb6dbd8

View File

@ -32,7 +32,7 @@ module.exports = function () {
fn.returnType &&
fn.returnType.typeAnnotation) {
var returnType = flowDoctrine(fn.returnType.typeAnnotation);
if (comment.returns) {
if (comment.returns && comment.returns.length > 0) {
comment.returns[0].type = returnType;
} else {
comment.returns = [{