CCM NG/ccm-core: MimeTypeConverter was not null safe
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4393 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
a87adf35fa
commit
e68a5ba5d2
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.jpa.utils;
|
package org.libreccm.jpa.utils;
|
||||||
|
|
||||||
|
|
||||||
import javax.activation.MimeType;
|
import javax.activation.MimeType;
|
||||||
import javax.activation.MimeTypeParseException;
|
import javax.activation.MimeTypeParseException;
|
||||||
import javax.persistence.AttributeConverter;
|
import javax.persistence.AttributeConverter;
|
||||||
|
|
@ -35,7 +34,11 @@ public class MimeTypeConverter implements AttributeConverter<MimeType, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String convertToDatabaseColumn(final MimeType attribute) {
|
public String convertToDatabaseColumn(final MimeType attribute) {
|
||||||
return attribute.toString();
|
if (attribute == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return attribute.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -47,6 +50,4 @@ public class MimeTypeConverter implements AttributeConverter<MimeType, String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue