Skip to content

Commit aa68cb1

Browse files
committed
[java] Making sure browser path is not null
Closes #12450
1 parent e69feee commit aa68cb1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

java/src/org/openqa/selenium/chrome/ChromeDriver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ private static ChromeDriverCommandExecutor generateExecutor(
9898
if (service.getExecutable() == null) {
9999
Result result = DriverFinder.getPath(service, options);
100100
service.setExecutable(result.getDriverPath());
101-
options.setBinary(result.getBrowserPath());
101+
if (result.getBrowserPath() != null) {
102+
options.setBinary(result.getBrowserPath());
103+
}
102104
}
103105
return new ChromeDriverCommandExecutor(service, clientConfig);
104106
}

java/src/org/openqa/selenium/edge/EdgeDriver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ private static EdgeDriverCommandExecutor generateExecutor(
7070
if (service.getExecutable() == null) {
7171
Result result = DriverFinder.getPath(service, options);
7272
service.setExecutable(result.getDriverPath());
73-
options.setBinary(result.getBrowserPath());
73+
if (result.getBrowserPath() != null) {
74+
options.setBinary(result.getBrowserPath());
75+
}
7476
}
7577
return new EdgeDriverCommandExecutor(service, clientConfig);
7678
}

java/src/org/openqa/selenium/firefox/FirefoxDriver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ private static FirefoxDriverCommandExecutor generateExecutor(
140140
if (service.getExecutable() == null) {
141141
Result result = DriverFinder.getPath(service, options);
142142
service.setExecutable(result.getDriverPath());
143-
options.setBinary(result.getBrowserPath());
143+
if (result.getBrowserPath() != null) {
144+
options.setBinary(result.getBrowserPath());
145+
}
144146
}
145147
return new FirefoxDriverCommandExecutor(service, clientConfig);
146148
}

0 commit comments

Comments
 (0)