🐛 Fixed null displayed on empty post content (#10617)

refs #10612

- Added `null` value handling to {{content}} helper, which is same to how {{exerpt}} helper handles `null` values at the moment
This commit is contained in:
Eol 2019-03-18 12:46:59 +01:00 committed by Naz Gargol
parent 608718ff26
commit 9a21bea2c7

View File

@ -18,6 +18,10 @@ module.exports = function content(options) {
truncateOptions[key] = parseInt(truncateOptions[key], 10); truncateOptions[key] = parseInt(truncateOptions[key], 10);
}); });
if (this.html === null) {
this.html = '';
}
if (truncateOptions.hasOwnProperty('words') || truncateOptions.hasOwnProperty('characters')) { if (truncateOptions.hasOwnProperty('words') || truncateOptions.hasOwnProperty('characters')) {
return new SafeString( return new SafeString(
downsize(this.html, truncateOptions) downsize(this.html, truncateOptions)