C
C#17mo ago
devhl

❔ Utf8JsonReader.GetString exceptions

This document seems to contradict itself. The returns section says if the token is null then you get null, but the exceptions say null will cause an exception. Am I understanding this right and it is wrong documentation? https://learn.microsoft.com/en-us/dotnet/api/system.text.json.utf8jsonreader.getstring?view=net-7.0#returns
Utf8JsonReader.GetString Method (System.Text.Json)
Reads the next JSON token value from the source unescaped and transcodes it as a string.
6 Replies
mtreit
mtreit17mo ago
Where does it say that null will cause an exception?
devhl
devhl17mo ago
devhl
devhl17mo ago
The last word.
mtreit
mtreit17mo ago
That says the exact opposite It's saying it will throw if the value is NOT one of: 1. A string. 2. A PropertyName 3. Null
devhl
devhl17mo ago
oh... oh there are try versions of these commands, nice
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts