Prevent NPE when trying to create a deep copy (#13513)

This commit is contained in:
Chris
2023-04-03 08:59:45 +02:00
committed by GitHub
parent d21e03938e
commit 7e318cbd44
2 changed files with 2 additions and 2 deletions
@@ -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