Skip to content

Commit d3ddc71

Browse files
committed
java: Adding a guard for the case of empty sessionId (this case happens on the start of marionette connection)
1 parent 6fc17a0 commit d3ddc71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java/client/src/org/openqa/selenium/remote/JsonToBeanConverter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ private <T> T convert(Class<T> clazz, Object text, int depth) {
127127
response.setStatus(intStatus);
128128
}
129129
}
130-
response.setSessionId(json.get("sessionId").getAsString());
130+
if (json.has("sessionId") && ! json.get("sessionId").isJsonNull()) {
131+
response.setSessionId(json.get("sessionId").getAsString());
132+
}
131133

132134
response.setValue(convert(Object.class, json.get("value")));
133135

0 commit comments

Comments
 (0)