Fixed null pointer exception when sending email manually
Fixed bad timeplotz dependency
This commit is contained in:
parent
fbd3a66cbd
commit
94f10b3866
2 changed files with 10 additions and 1 deletions
|
|
@ -19,6 +19,8 @@
|
||||||
|
|
||||||
package org.libreplan.importers.notifications;
|
package org.libreplan.importers.notifications;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.libreplan.business.common.entities.ConnectorProperty;
|
import org.libreplan.business.common.entities.ConnectorProperty;
|
||||||
import org.libreplan.business.email.entities.EmailNotification;
|
import org.libreplan.business.email.entities.EmailNotification;
|
||||||
import org.libreplan.business.email.entities.EmailTemplate;
|
import org.libreplan.business.email.entities.EmailTemplate;
|
||||||
|
|
@ -83,6 +85,8 @@ public class ComposeMessage {
|
||||||
|
|
||||||
private Properties properties;
|
private Properties properties;
|
||||||
|
|
||||||
|
private static final Log LOG = LogFactory.getLog(ComposeMessage.class);
|
||||||
|
|
||||||
|
|
||||||
public boolean composeMessageForUser(EmailNotification notification) {
|
public boolean composeMessageForUser(EmailNotification notification) {
|
||||||
// Gather data about EmailTemplate needs to be used
|
// Gather data about EmailTemplate needs to be used
|
||||||
|
|
@ -102,6 +106,11 @@ public class ComposeMessage {
|
||||||
|
|
||||||
EmailTemplate currentEmailTemplate = findCurrentEmailTemplate(type, locale);
|
EmailTemplate currentEmailTemplate = findCurrentEmailTemplate(type, locale);
|
||||||
|
|
||||||
|
if (currentEmailTemplate == null) {
|
||||||
|
LOG.error("Email template is null");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Modify text that will be composed
|
// Modify text that will be composed
|
||||||
String text = currentEmailTemplate.getContent();
|
String text = currentEmailTemplate.getContent();
|
||||||
text = replaceKeywords(text, currentWorker, notification);
|
text = replaceKeywords(text, currentWorker, notification);
|
||||||
|
|
|
||||||
2
pom.xml
2
pom.xml
|
|
@ -605,7 +605,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.zkoss.zkforge</groupId>
|
<groupId>org.zkoss.zkforge</groupId>
|
||||||
<artifactId>timeplotz</artifactId>
|
<artifactId>timeplotz</artifactId>
|
||||||
<version>1.1_50</version>
|
<version>1.1_50_1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue