fix for npe on map models

This commit is contained in:
Tony Tam 2015-10-20 08:48:04 -07:00
parent 539496d735
commit b827d06077

View File

@ -84,6 +84,8 @@ public class XmlExampleGenerator {
name = xml.getName();
}
}
// TODO: map objects will not enter this block
if(model.getProperties() != null) {
for (String pName : model.getProperties().keySet()) {
Property p = model.getProperties().get(pName);
if (p != null && p.getXml() != null && p.getXml().getAttribute() != null && p.getXml().getAttribute()) {
@ -92,6 +94,7 @@ public class XmlExampleGenerator {
elements.put(pName, p);
}
}
}
sb.append(indent(indent)).append(TAG_START);
sb.append(name);
for (String pName : attributes.keySet()) {