if(type.equals(Type.XML)){
XMLSerializer xmlSerializer = new XMLSerializer();
- if(isCollectionType){
+ if(isCollectionType && entity != null){ //can never be null here but there is an IDE warning otherwise
xmlSerializer.setArrayName(entity.getClass().getSimpleName());
Class<?> elementType = Object.class;
Collection<?> c = (Collection<?>)entity;
try {
OffsetDateTime dateTime = OffsetDateTime.now();
- // from chain.doFilter() NestedServletExceptions with NPEs may bubble up from
+ // from chain.doFilter() NestedServletExceptions with NPEs may bubble up
// from controller methods which miss proper handling of not found entities or the like
// (HTTP 404 : uuid not found)
// These situations are caught below and logged at info level for debugging purposes