From 28d6e77ce7592d03c411b3f3c9cc69d1ea7c0e53 Mon Sep 17 00:00:00 2001 From: streamich Date: Tue, 21 Jan 2020 00:09:13 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20do=20not=20format=20body?= =?UTF-8?q?=20as=20undefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/formatCommitMessage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/formatCommitMessage.js b/lib/formatCommitMessage.js index 7c4324c2..45c8bc7c 100644 --- a/lib/formatCommitMessage.js +++ b/lib/formatCommitMessage.js @@ -1,3 +1,5 @@ +/* eslint-disable complexity */ + const wrap = require('word-wrap'); const MAX_LINE_WIDTH = 72; @@ -38,7 +40,7 @@ const formatCommitMessage = (state) => { const affectsLine = makeAffectsLine(answers); // Wrap these lines at MAX_LINE_WIDTH character - const body = wrap(answers.body + affectsLine, wrapOptions); + const body = wrap((answers.body || '') + affectsLine, wrapOptions); const breaking = wrap(answers.breaking, wrapOptions); const issues = wrap(answers.issues, wrapOptions);