if (value != null) {
// the value should ALWAYS be a decendant of TemplateModel
if (value instanceof TemplateModel) {
try {
map.put(entry.getKey(), objectWrapper
.unwrap((TemplateModel) value));
} catch (TemplateModelException e) {
LOG.error("failed to unwrap [" + value
+ "] it will be ignored", e);
}