Skip to content

Commit 6f350ec

Browse files
committed
Fixed issue: add check to cover scenarios where content type not set.
1 parent c8d67a0 commit 6f350ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/microsoft/graph/http/CoreHttpProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public MediaType contentType() {
391391
final Map<String, String> headers = CoreHttpProvider.getResponseHeadersAsMapStringString(response);
392392

393393
final String contentType = headers.get(Constants.CONTENT_TYPE_HEADER_NAME);
394-
if (contentType.contains(Constants.JSON_CONTENT_TYPE)) {
394+
if (contentType != null && contentType.contains(Constants.JSON_CONTENT_TYPE)) {
395395
logger.logDebug("Response json");
396396
return handleJsonResponse(in, CoreHttpProvider.getResponseHeadersAsMapOfStringList(response), resultClass);
397397
} else {

0 commit comments

Comments
 (0)