diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee067e..ae25aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed + +- Fixed trying to generate sitemap for empty component. + ## [0.2.0] - 2023-12-24 ### Added diff --git a/src/main/java/com/refinedmods/refinedsites/render/Renderer.java b/src/main/java/com/refinedmods/refinedsites/render/Renderer.java index 697dd98..695614c 100644 --- a/src/main/java/com/refinedmods/refinedsites/render/Renderer.java +++ b/src/main/java/com/refinedmods/refinedsites/render/Renderer.java @@ -208,6 +208,9 @@ private Path getComponentOutputPath(final Component component) throws IOExceptio private WebSitemapGenerator getWebSitemapGenerator(final Component component, final String sitemapBaseUrl, final Path componentOutputPath) { + if (component.getPages().isEmpty()) { + return null; + } if (component.isLatest()) { try { return new WebSitemapGenerator(sitemapBaseUrl, componentOutputPath.toFile());