Skip to content

Commit f15167a

Browse files
author
Andrew Omondi
committed
pr review feedback.
1 parent 7da16f7 commit f15167a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Microsoft.Graph.Core/Requests/BatchRequestBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ private static async Task ThrowIfFailedResponseAsync(HttpResponseMessage httpRes
108108
{
109109
if (httpResponseMessage.IsSuccessStatusCode) return;
110110

111-
if (CoreConstants.MimeTypeNames.Application.Json.Equals(httpResponseMessage.Content?.Headers?.ContentType?.MediaType, StringComparison.OrdinalIgnoreCase))
111+
var contentTypeString = httpResponseMessage.Content?.Headers?.ContentType?.MediaType is { } contentTypeMediaType && !string.IsNullOrEmpty(contentTypeMediaType) ? contentTypeMediaType : string.Empty;
112+
if (httpResponseMessage.Content != null && contentTypeString.StartsWith(CoreConstants.MimeTypeNames.Application.Json, StringComparison.OrdinalIgnoreCase))
112113
{
113114
using var responseContent = await httpResponseMessage.Content.ReadAsStreamAsync().ConfigureAwait(false);
114115
using var document = await JsonDocument.ParseAsync(responseContent).ConfigureAwait(false);

0 commit comments

Comments
 (0)