Skip to content

Commit

Permalink
Merge pull request #1 from milarze/bugfix/build-failure-when-ghost-ha…
Browse files Browse the repository at this point in the history
…s-no-posts

[BUGFIX] Build failure when Ghost blog has no posts
  • Loading branch information
nishantdania committed Mar 5, 2019
2 parents 91a1646 + 192f048 commit 7714c5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/rss/generate-feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const generateItem = function generateItem(post) {

const generateRSSFeed = function generateRSSFeed(siteConfig) {
return {
serialize: ({ query: { allGhostPost } }) => allGhostPost.edges.map(edge => Object.assign({}, generateItem(edge.node))),
serialize: ({ query: { allGhostPost } }) => allGhostPost && allGhostPost.edges.map(edge => Object.assign({}, generateItem(edge.node))) || [],
setup: ({ query: { allGhostSettings } }) => {
const siteTitle = allGhostSettings.edges[0].node.title || `No Title`
const siteDescription = allGhostSettings.edges[0].node.description || `No Description`
Expand Down

0 comments on commit 7714c5d

Please sign in to comment.