Skip to content

Commit

Permalink
Fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
ia3andy committed Jun 27, 2024
1 parent 08a59e7 commit af429ff
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 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 @@ -6,6 +6,7 @@
import java.util.List;
import java.util.Set;

import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
import org.jboss.logging.Logger;

import io.quarkiverse.roq.generator.runtime.FixedStaticPagesProvider;
Expand All @@ -32,9 +33,10 @@ FeatureBuildItem feature() {
}

@BuildStep
void produceBeans(BuildProducer<AdditionalBeanBuildItem> additionalBeanProducer) {
void produceBeans(BuildProducer<AdditionalBeanBuildItem> additionalBeanProducer, BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClassProducer) {
additionalBeanProducer.produce(AdditionalBeanBuildItem.unremovableOf(RoqGenerator.class));
additionalBeanProducer.produce(AdditionalBeanBuildItem.unremovableOf(FixedStaticPagesProvider.class));
runtimeInitializedClassProducer.produce(new RuntimeInitializedClassBuildItem(FixedStaticPagesProvider.class.getName()));
}

@BuildStep
Expand Down
Original file line number Diff line number Diff line change
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 af429ff

Please sign in to comment.