Skip to content

Commit d08708f

Browse files
committed
Handle if value.sessionId is null
1 parent cfe97f8 commit d08708f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dotnet/src/webdriver/Response.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static Response FromJson(string value)
9595
{
9696
// Special case code for the new session command. If the response contains
9797
// sessionId and capabilities properties, fix up the session ID and value members.
98-
if (valueDictionary.TryGetPropertyValue("sessionId", out JsonNode? session))
98+
if (valueDictionary.TryGetPropertyValue("sessionId", out JsonNode? session) && session is not null)
9999
{
100100
sessionId = session.ToString();
101101
if (valueDictionary.TryGetPropertyValue("capabilities", out JsonNode? capabilities))

0 commit comments

Comments
 (0)