Skip to content

Commit

Permalink
🐛 Fixed 500 error on /rss/ when a post has no content
Browse files Browse the repository at this point in the history
refs #10679

- this was a regression introduced after extracting our url-utils package
- `urlUtils.htmlRelativeToAbsolute(html)` will return `null` rather than an empty string if `html` is explicitly passed in as `null`
  • Loading branch information
kevinansfield committed Dec 18, 2019
1 parent d964dec commit 2580276
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/frontend/services/rss/generate-feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ generateTags = function generateTags(data) {

generateItem = function generateItem(post, secure) {
const itemUrl = urlService.getUrlByResourceId(post.id, {secure, absolute: true});
const htmlContent = cheerio.load(urlUtils.htmlRelativeToAbsolute(post.html, itemUrl, {secure}), {decodeEntities: false});
const html = post.html ? urlUtils.htmlRelativeToAbsolute(post.html, itemUrl, {secure}) : '';
const htmlContent = cheerio.load(html, {decodeEntities: false});
const item = {
title: post.title,
// @TODO: DRY this up with data/meta/index & other excerpt code
Expand Down

0 comments on commit 2580276

Please sign in to comment.