From 8cd6f8eb17f41cef0bb99055672b59d7dede722b Mon Sep 17 00:00:00 2001 From: uwaa Date: Mon, 9 Dec 2024 22:30:43 +0000 Subject: [PATCH] http: nitpick --- HTTP/MIMEType.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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); }