Skip to content

Commit

Permalink
Fix WebDriverException when binary is set, but no firefox binary on t…
Browse files Browse the repository at this point in the history
…he PATH. (#5039)

The cause of the problem is to call the orElse method with new instance of FirefoxBinary as argument,
which requires Firefox binary in environment variable PATH.
  • Loading branch information
darek8686 authored and shs96c committed Nov 15, 2017
1 parent 7fff2dc commit b29e332
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public FirefoxOptions setBinary(String path) {
* useful when actually starting firefox.
*/
public FirefoxBinary getBinary() {
return getBinaryOrNull().orElse(new FirefoxBinary());
return getBinaryOrNull().orElseGet(FirefoxBinary::new);
}

public Optional<FirefoxBinary> getBinaryOrNull() {
Expand Down

0 comments on commit b29e332

Please sign in to comment.