Skip to content

Commit 19a73bb

Browse files
committed
Discriminator cannot be null
1 parent abb528f commit 19a73bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dotnet/src/webdriver/BiDi/Communication/Json/Internal/JsonExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace OpenQA.Selenium.BiDi.Communication.Json.Internal;
2323

2424
internal static class JsonExtensions
2525
{
26-
public static string? GetDiscriminator(this ref Utf8JsonReader reader, string name)
26+
public static string GetDiscriminator(this ref Utf8JsonReader reader, string name)
2727
{
2828
Utf8JsonReader readerClone = reader;
2929

@@ -48,6 +48,6 @@ internal static class JsonExtensions
4848
readerClone.Read();
4949
}
5050

51-
return discriminator;
51+
return discriminator ?? throw new JsonException($"Couldn't determine '{name}' descriminator.");
5252
}
5353
}

0 commit comments

Comments
 (0)