diff --git a/HTTP/MIMEType.cs b/HTTP/MIMEType.cs index b9aa3c3..be4ca5a 100644 --- a/HTTP/MIMEType.cs +++ b/HTTP/MIMEType.cs @@ -90,10 +90,7 @@ class MIMETypeConverter : JsonConverter public override MIMEType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { - string? str = reader.GetString(); - if (str == null) - throw new JsonException("Cannot read MIME type"); - + string? str = reader.GetString() ?? throw new JsonException("Cannot read MIME type"); return new MIMEType(str); }