Nullability refinements and related polishing

This commit is contained in:
Juergen Hoeller
2021-02-14 17:57:32 +01:00
parent 99a1388bbd
commit df977a2fd2
9 changed files with 32 additions and 16 deletions

View File

@@ -203,7 +203,8 @@ public abstract class AbstractMessageConverterMethodArgumentResolver implements
(noContentType && !message.hasBody())) {
return null;
}
throw new HttpMediaTypeNotSupportedException(contentType, getSupportedMediaTypes(targetClass));
throw new HttpMediaTypeNotSupportedException(contentType,
getSupportedMediaTypes(targetClass != null ? targetClass : Object.class));
}
MediaType selectedContentType = contentType;