Skip to content

Commit

Permalink
Merge pull request #1402 from gritGmbH/enhancement/fix-null-exception…
Browse files Browse the repository at this point in the history
…-serializer-85

Prevent serialization of exceptions with "null" message
  • Loading branch information
copierrj authored Nov 23, 2022
2 parents 73c1a20 + 603172c commit 339856f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void serializeExceptionToXML( XMLStreamWriter writer, OWSException ex )
writer.writeAttribute( "locator", ex.getLocator() );
}
writer.writeStartElement( OWS_NS, "ExceptionText" );
writer.writeCharacters( ex.getMessage() );
writer.writeCharacters( ex.getMessage() != null ? ex.getMessage() : "not available" );
writer.writeEndElement();
writer.writeEndElement(); // Exception
writer.writeEndElement(); // ExceptionReport
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void serializeExceptionToXML( XMLStreamWriter writer, OWSException ex )
if ( ex.getLocator().length() > 0 ) {
writer.writeAttribute( "locator", ex.getLocator() );
}
writer.writeCharacters( ex.getMessage() );
writer.writeCharacters( ex.getMessage() != null ? ex.getMessage() : "not available" );
writer.writeEndElement(); // ServiceException
writer.writeEndElement(); // ServiceExceptionReport
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void serializeExceptionToXML( XMLStreamWriter writer, OWSException ex )
if ( ex.getLocator() != null && !"".equals( ex.getLocator().trim() ) ) {
writer.writeAttribute( "locator", ex.getLocator() );
}
writer.writeCharacters( ex.getMessage() );
writer.writeCharacters( ex.getMessage() != null ? ex.getMessage() : "not available" );
writer.writeEndElement(); // ServiceException
writer.writeEndElement(); // ServiceExceptionReport
}
Expand Down

0 comments on commit 339856f

Please sign in to comment.