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

Commit

Permalink
fixes NullPointerException; closes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
klieber committed Dec 17, 2013
1 parent 6e4c786 commit c97d1b9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.Commandline;

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

0 comments on commit c97d1b9

Please sign in to comment.