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-94f89814c4dfmaster
parent
3583e34978
commit
ddfd5de81c
|
|
@ -137,7 +137,13 @@ public class SimpleXMLGenerator implements XMLGenerator {
|
||||||
//ContentSection section = CMS.getContext().getContentSection();
|
//ContentSection section = CMS.getContext().getContentSection();
|
||||||
ContentItem item = getContentItem(state);
|
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();
|
Party currentParty = Kernel.getContext().getParty();
|
||||||
if (currentParty == null) {
|
if (currentParty == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue