[#2098] NullPointerException when org.jooq.impl.EnumConverter

converts null
This commit is contained in:
Lukas Eder 2013-01-06 17:49:08 +01:00
parent c34efabcf2
commit 43cb9fb520

View File

@ -83,7 +83,10 @@ public class EnumConverter<T, U extends Enum<U>> implements Converter<T, U> {
*/
@Override
public T to(U userObject) {
if (enumType == EnumType.ORDINAL) {
if (userObject == null) {
return null;
}
else if (enumType == EnumType.ORDINAL) {
return convert(userObject.ordinal(), fromType);
}
else {