CCM NG/ccm-core: MimeTypeConverter now works with null values for the MimeType in the database

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4884 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2017-07-25 14:54:57 +00:00
parent 1d69f0a0ab
commit d6cffc1b91
1 changed files with 3 additions and 0 deletions

View File

@ -43,6 +43,9 @@ public class MimeTypeConverter implements AttributeConverter<MimeType, String> {
@Override @Override
public MimeType convertToEntityAttribute(final String dbData) { public MimeType convertToEntityAttribute(final String dbData) {
if (dbData == null) {
return null;
}
try { try {
return new MimeType(dbData); return new MimeType(dbData);
} catch (MimeTypeParseException ex) { } catch (MimeTypeParseException ex) {