From 4a7a97b338327d8027edab6358e8a9bac67d8865 Mon Sep 17 00:00:00 2001 From: Evgeny Valavin <35497422+evgenyvalavin@users.noreply.github.com> Date: Sat, 5 Nov 2022 19:10:44 +0500 Subject: [PATCH] Bugfix. NRE in NativeHttpClient.HandleNotSuccessStatusCode(...) (#24) --- src/Arbus.Network/NativeHttpClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Arbus.Network/NativeHttpClient.cs b/src/Arbus.Network/NativeHttpClient.cs index 70622cf..0fe6f19 100644 --- a/src/Arbus.Network/NativeHttpClient.cs +++ b/src/Arbus.Network/NativeHttpClient.cs @@ -78,7 +78,7 @@ public virtual Task EnsureSuccessResponse(HttpResponseMessa public virtual Task HandleNotSuccessStatusCode(HttpResponseMessage response) { - if (response.Content.Headers.ContentType.MediaType == HttpContentType.Application.ProblemJson) + if (response.Content.Headers.ContentType?.MediaType == HttpContentType.Application.ProblemJson) return HandleProblemDetailsResponse(response); else return HandleAnyResponse(response);