From 9a21bea2c7b57943702dfff076b541e512084d78 Mon Sep 17 00:00:00 2001 From: Eol <23345063+e-ol@users.noreply.github.com> Date: Mon, 18 Mar 2019 12:46:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20`null`=20displayed=20on?= =?UTF-8?q?=20empty=20post=20content=20(#10617)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs #10612 - Added `null` value handling to {{content}} helper, which is same to how {{exerpt}} helper handles `null` values at the moment --- core/server/helpers/content.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/server/helpers/content.js b/core/server/helpers/content.js index 6c1f32d591..af22a59a4d 100644 --- a/core/server/helpers/content.js +++ b/core/server/helpers/content.js @@ -18,6 +18,10 @@ module.exports = function content(options) { truncateOptions[key] = parseInt(truncateOptions[key], 10); }); + if (this.html === null) { + this.html = ''; + } + if (truncateOptions.hasOwnProperty('words') || truncateOptions.hasOwnProperty('characters')) { return new SafeString( downsize(this.html, truncateOptions)