Prevent NPE when trying to create a deep copy (#13513)
This commit is contained in:
parent
d21e03938e
commit
7e318cbd44
|
@ -59,7 +59,7 @@ public class CustomIntegerArrayType implements UserType {
|
|||
@Override
|
||||
public Object deepCopy(Object value) throws HibernateException {
|
||||
Integer[] a = (Integer[])value;
|
||||
return Arrays.copyOf(a, a.length);
|
||||
return a != null ? Arrays.copyOf(a, a.length) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -59,7 +59,7 @@ public class CustomStringArrayType implements UserType {
|
|||
@Override
|
||||
public Object deepCopy(Object value) throws HibernateException {
|
||||
String[] a = (String[])value;
|
||||
return Arrays.copyOf(a, a.length);
|
||||
return a != null ? Arrays.copyOf(a, a.length) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue