Skip to content

Commit

Permalink
Remove duplicate null check and add link to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sbardian committed Apr 4, 2019
1 parent f261e62 commit 06fb672
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/gatsby-plugin-sitemap/src/internals.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ export const runQuery = (handler, query, excludes, pathPrefix) =>
})

if (!r.data.site.siteMetadata.siteUrl) {
throw new Error(`SiteMetaData 'siteUrl' property is required`)
}

if (r.data.site.siteMetadata.siteUrl) {
// remove trailing slash of siteUrl
r.data.site.siteMetadata.siteUrl = withoutTrailingSlash(
r.data.site.siteMetadata.siteUrl
throw new Error(
`SiteMetaData 'siteUrl' property is required. (https://www.gatsbyjs.org/packages/gatsby-plugin-sitemap/#how-to-use)`
)
}

// remove trailing slash of siteUrl
r.data.site.siteMetadata.siteUrl = withoutTrailingSlash(
r.data.site.siteMetadata.siteUrl
)

return r.data
})

Expand Down

0 comments on commit 06fb672

Please sign in to comment.