Skip to content

Commit

Permalink
Merge pull request #27 from ia3andy/fix-npe
Browse files Browse the repository at this point in the history
Fix NPE
  • Loading branch information
ia3andy authored Jun 27, 2024
2 parents 42d586b + e54f7d9 commit 3211544
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties

.quarkus
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void produceBeans(BuildProducer<AdditionalBeanBuildItem> additionalBeanProducer)
}

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
@Record(ExecutionTime.STATIC_INIT)
void initHandler(List<NotFoundPageDisplayableEndpointBuildItem> notFoundPageDisplayableEndpoints,
StaticResourcesBuildItem staticResourcesBuildItem,
OutputTargetBuildItem outputTarget,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@Singleton
public class FixedStaticPagesProvider {
private static String targetDir;
private static volatile String targetDir;
@Inject
RoqGeneratorConfig config;

Expand Down Expand Up @@ -42,13 +42,16 @@ StaticPages produce() {
StaticPages.add(StaticPage.builder().path(p).fixed().build());
continue;
}
// Try to detect fixed paths from glob pattern
for (String staticPath : staticPaths) {
PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + p);
if (matcher.matches(Path.of(staticPath))) {
StaticPages.add(StaticPage.builder().fixed().path(staticPath).build());
if (staticPaths != null) {
// Try to detect fixed paths from glob pattern
for (String staticPath : staticPaths) {
PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:" + p);
if (matcher.matches(Path.of(staticPath))) {
StaticPages.add(StaticPage.builder().fixed().path(staticPath).build());
}
}
}

}
return new StaticPages(StaticPages);
}
Expand Down

0 comments on commit 3211544

Please sign in to comment.