Skip to content

Commit cddff58

Browse files
committed
Fixing possible NPE while reading hub config file. Fixes #5575
1 parent c10d314 commit cddff58

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

java/server/src/org/openqa/grid/internal/cli/GridHubCliOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private IDefaultProvider defaults(String json) {
4949
map.remove("custom");
5050
return optionName -> {
5151
String option = optionName.replaceAll("-", "");
52-
return map.containsKey(option) ? map.get(option).toString() : null;
52+
return map.containsKey(option) && map.get(option) != null ? map.get(option).toString() : null;
5353
};
5454
}
5555

java/server/test/org/openqa/grid/e2e/misc/GridViaCommandLineTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ public void canStartHubUsingConfigFile() throws Exception {
250250
+ " \"servlets\" : [],\n"
251251
+ " \"withoutServlets\": [],\n"
252252
+ " \"custom\": {},\n"
253+
+ " \"prioritizer\": null,\n"
253254
+ " \"capabilityMatcher\": \"org.openqa.grid.internal.utils.DefaultCapabilityMatcher\",\n"
254255
+ " \"registry\": \"org.openqa.grid.internal.DefaultGridRegistry\",\n"
255256
+ " \"throwOnCapabilityNotPresent\": true,\n"

0 commit comments

Comments
 (0)