Skip to content

Commit 9027c99

Browse files
committed
refactor(error-filter): simplify check for headers and content type
1 parent 350c2b1 commit 9027c99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/IBM.WatsonDeveloperCloud/Http/Filters/ErrorFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void OnResponse(IResponse response, HttpResponseMessage responseMessage)
3434

3535
var error = responseMessage.Content.ReadAsStringAsync().Result;
3636

37-
if (responseMessage.Content.Headers.ContentType != null && responseMessage.Content.Headers.ContentType.MediaType == HttpMediaType.APPLICATION_JSON)
37+
if (responseMessage.Content.Headers?.ContentType?.MediaType == HttpMediaType.APPLICATION_JSON)
3838
{
3939
exception.Error = JsonConvert.DeserializeObject<Error>(error);
4040
}

0 commit comments

Comments
 (0)