Skip to content
This repository was archived by the owner on Apr 5, 2019. It is now read-only.

Commit c97d1b9

Browse files
committed
fixes NullPointerException; closes #6
1 parent 6e4c786 commit c97d1b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/github/klieber/phantomjs/mojo/InstallPhantomJsMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.apache.maven.plugins.annotations.LifecyclePhase;
2828
import org.apache.maven.plugins.annotations.Mojo;
2929
import org.apache.maven.plugins.annotations.Parameter;
30+
import org.codehaus.plexus.util.StringUtils;
3031
import org.codehaus.plexus.util.cli.Commandline;
3132

3233
import java.io.*;
@@ -128,7 +129,7 @@ private String findBinaryOnSystemPath() throws MojoExecutionException {
128129
try {
129130
Process process = new ProcessBuilder(commandline.getShellCommandline()).start();
130131
BufferedReader standardOut = new BufferedReader(new InputStreamReader(process.getInputStream()));
131-
String versionString = standardOut.readLine().trim();
132+
String versionString = StringUtils.trim(standardOut.readLine());
132133
int exitCode = process.waitFor();
133134
if (exitCode == 0 && (!enforceVersion || this.version.equals(versionString))) {
134135
getLog().info("Found phantomjs "+versionString+" on the system path.");

0 commit comments

Comments
 (0)