CCM NG/ccm-core: MimeTypeConverter was not null safe

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4393 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-10-19 18:05:53 +00:00
parent a87adf35fa
commit e68a5ba5d2
1 changed files with 6 additions and 5 deletions

View File

@ -18,7 +18,6 @@
*/
package org.libreccm.jpa.utils;
import javax.activation.MimeType;
import javax.activation.MimeTypeParseException;
import javax.persistence.AttributeConverter;
@ -35,7 +34,11 @@ public class MimeTypeConverter implements AttributeConverter<MimeType, String> {
@Override
public String convertToDatabaseColumn(final MimeType attribute) {
return attribute.toString();
if (attribute == null) {
return null;
} else {
return attribute.toString();
}
}
@Override
@ -47,6 +50,4 @@ public class MimeTypeConverter implements AttributeConverter<MimeType, String> {
}
}
}