Skip to content

Commit 2a78f28

Browse files
committed
null check instead
1 parent d08708f commit 2a78f28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dotnet/src/webdriver/Response.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ 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) && session is not null)
98+
if (valueDictionary.TryGetPropertyValue("sessionId", out JsonNode? session))
9999
{
100-
sessionId = session.ToString();
100+
sessionId = session?.ToString();
101101
if (valueDictionary.TryGetPropertyValue("capabilities", out JsonNode? capabilities))
102102
{
103103
contents = capabilities;

0 commit comments

Comments
 (0)