Skip to content

Commit

Permalink
handling some NPE's that can happen if config values aren't set
Browse files Browse the repository at this point in the history
TODO: we need some tests of the SeleniumServer class
  • Loading branch information
lukeis committed Mar 17, 2016
1 parent cc199ba commit aa924a8
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ public void boot() {
handler.setContextPath("/");
handler.addServlet(DriverServlet.class, "/wd/hub/*");

handler.setInitParameter(DriverServlet.BROWSER_TIMEOUT_PARAMETER, String.valueOf(configuration.browserTimeout));
handler.setInitParameter(DriverServlet.SESSION_TIMEOUT_PARAMETER, String.valueOf(configuration.timeout));
if (configuration.browserTimeout != null) {
handler.setInitParameter(DriverServlet.BROWSER_TIMEOUT_PARAMETER,
String.valueOf(configuration.browserTimeout));
}
if (configuration.timeout != null) {
handler.setInitParameter(DriverServlet.SESSION_TIMEOUT_PARAMETER,
String.valueOf(configuration.timeout));
}

addRcSupport(handler);

Expand All @@ -107,6 +113,9 @@ public void boot() {
httpConfig.setSecureScheme("https");

ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(httpConfig));
if (configuration.port == null) {
configuration.port = 4444;
}
http.setPort(configuration.port);
http.setIdleTimeout(500000);

Expand Down

0 comments on commit aa924a8

Please sign in to comment.