From 088754fb1e724e3e4d8f43b6e4905d98bfcf99fc Mon Sep 17 00:00:00 2001 From: Axel Date: Fri, 14 Apr 2017 03:32:13 +0200 Subject: [PATCH] Fixing n.comments check in printer (#1239) --- src/printer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printer.js b/src/printer.js index 86705f64f..84d58d146 100644 --- a/src/printer.js +++ b/src/printer.js @@ -1351,7 +1351,7 @@ function genericPrintNoParens(path, options, print, args) { case "JSXText": throw new Error("JSXTest should be handled by JSXElement"); case "JSXEmptyExpression": - const requiresHardline = n.comments.some( + const requiresHardline = n.comments && n.comments.some( comment => comment.type === "Line" || comment.type === "CommentLine" );