Protecting from possible NPE in SimpleXMLGenerator. At the moment a fatal error is reported polluting the log. Now only a warning will be put into the log.

git-svn-id: https://svn.libreccm.org/ccm/trunk@4746 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2017-05-21 07:20:57 +00:00
parent 3583e34978
commit ddfd5de81c
1 changed files with 7 additions and 1 deletions

View File

@ -137,7 +137,13 @@ public class SimpleXMLGenerator implements XMLGenerator {
//ContentSection section = CMS.getContext().getContentSection();
ContentItem item = getContentItem(state);
s_log.info("Generate XML for item " + item.getOID());
if (item == null) {
s_log.warn(String.format("Item in SimpleXMLGenerator '%s' is null. No XML will be generated.",
getClass().getName()));
return;
} else {
s_log.info("Generate XML for item " + item.getOID());
}
Party currentParty = Kernel.getContext().getParty();
if (currentParty == null) {