fix null pointer (#11)

This commit is contained in:
Yevgeniy Poluektov 2017-04-28 16:06:30 +03:00 committed by GitHub
parent 799d6994c9
commit 51e62d07f6

View File

@ -181,8 +181,10 @@ public class MessageDaoImpl extends NamedParameterJdbcDaoSupport implements Mess
}
private void putToCache(Message message){
cacheManager.getCache(CacheConfiguration.MESSAGES_BY_IDS).put(message.getId(), message);
cacheManager.getCache(CacheConfiguration.MESSAGES_BY_INVOICE).put(message.getInvoiceId(), message);
if(message != null) {
cacheManager.getCache(CacheConfiguration.MESSAGES_BY_IDS).put(message.getId(), message);
cacheManager.getCache(CacheConfiguration.MESSAGES_BY_INVOICE).put(message.getInvoiceId(), message);
}
}
private List<Message> getFromCache(Collection<Long> ids) {