Skip to content

Commit

Permalink
Merge pull request #22075 from gastaldi/npe
Browse files Browse the repository at this point in the history
Fix potential NullPointerException
  • Loading branch information
mkouba authored Dec 10, 2021
2 parents d619cc1 + 11efcc2 commit 8bc2149
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import java.util.Map.Entry;
import java.util.function.BiFunction;

import org.jboss.logging.Logger;

import io.quarkus.deployment.IsDevelopment;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Record;
Expand All @@ -34,8 +32,6 @@

public class QuteDevConsoleProcessor {

private static final Logger LOG = Logger.getLogger(QuteDevConsoleProcessor.class);

@BuildStep
@Record(value = STATIC_INIT, optional = true)
DevConsoleRouteBuildItem invokeEndpoint(QuteDevConsoleRecorder recorder) {
Expand Down Expand Up @@ -122,7 +118,7 @@ private Map<String, String> processVariants(List<TemplatePathBuildItem> template
for (String variant : variants) {
String source = templatePaths.stream().filter(p -> p.getPath().equals(variant))
.map(TemplatePathBuildItem::getContent).findFirst()
.orElse(null);
.orElse("");
source = source.replace("\n", "\\n");
variantsMap.put(variant, source);
}
Expand Down

0 comments on commit 8bc2149

Please sign in to comment.