Skip to content

Commit

Permalink
Merge pull request quarkusio#2713 from rsvoboda/CreateProjectMojo.NPE…
Browse files Browse the repository at this point in the history
….fix

Fixes quarkusio#2712 - filter out null objects from extensions set
  • Loading branch information
gsmet authored Jun 4, 2019
2 parents 8d8436c + ecfb978 commit 76b81be
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -141,6 +142,7 @@ public void execute() throws MojoExecutionException {

boolean success;
try {
sanitizeExtensions();
final SourceType sourceType = CreateProject.determineSourceType(extensions);
sanitizeOptions(sourceType);

Expand Down Expand Up @@ -290,8 +292,10 @@ private void sanitizeOptions(SourceType sourceType) {
path = "/" + path;
}
}
}

extensions = extensions.stream().map(String::trim).collect(Collectors.toSet());
private void sanitizeExtensions() {
extensions = extensions.stream().filter(Objects::nonNull).map(String::trim).collect(Collectors.toSet());
}

private void printUserInstructions(File root) {
Expand Down

0 comments on commit 76b81be

Please sign in to comment.