Fix potential NullPointerException in ParameterMetadataProvider.

We now guard against null values returned from ParameterExpression.getJavaType() before inspecting the value further as it turns out that Class.isAssignableFrom(…) chokes on null values being passed.

Looks like Hibernate six returns null in scenarios it previously didn't.
This commit is contained in:
Oliver Drotbohm
2022-05-17 17:42:01 +02:00
parent 76412cce9c
commit 13ae7e586a

View File

@@ -237,6 +237,10 @@ class ParameterMetadataProvider {
Class<? extends T> expressionType = expression.getJavaType();
if (expressionType == null) {
return value;
}
if (String.class.equals(expressionType)) {
switch (type) {