Skip to content

Commit 0ce6e21

Browse files
committed
Fixing broken CrossDomainRpcLoader
1 parent df9aa54 commit 0ce6e21

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: java/server/src/org/openqa/selenium/remote/server/xdrpc/CrossDomainRpcLoader.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ private String getField(JsonObject json, String key) {
6868
throw new IllegalArgumentException("Missing required parameter: " + key);
6969
}
7070

71-
if (!(json.get(key).isJsonPrimitive() && json.get(key).getAsJsonPrimitive().isString())) {
72-
throw new IllegalArgumentException(key + " is not a string");
71+
if (json.get(key).isJsonPrimitive() && json.get(key).getAsJsonPrimitive().isString()) {
72+
return json.get(key).getAsString();
73+
} else {
74+
return json.get(key).toString();
7375
}
74-
75-
return json.get(key).getAsString();
7676
}
7777

7878
/**

0 commit comments

Comments
 (0)