Fix for build, which was failing on MvcEvent being null in one of the tests.

This commit is contained in:
Jon Brisbin
2011-03-29 15:17:23 -05:00
committed by J. Brisbin
parent 1b9726c3b6
commit 8e9cf3a9b1

View File

@@ -1205,7 +1205,13 @@ public class MongoTemplate implements InitializingBean, MongoOperations, Applica
public T doWith(DBObject object) {
maybeEmitEvent(new AfterLoadEvent<DBObject>(object));
T source = reader.read(type, object);
maybeEmitEvent(new AfterConvertEvent<T>(object, source));
if (null != source) {
maybeEmitEvent(new AfterConvertEvent<T>(object, source));
} else {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Source object was <NULL>, so couldn't fire AfterConvertEvent<" + type.getName() + ">");
}
}
return source;
}
}