Fixed: EmailServices.sendMail causes a NPE, when sendFrom is missing

(OFBIZ-10706)

I tried to find the history for why the service does not take the 
defaultFromEmailAddress property from general.properties and I found that It was 
last modified in revision r418498 on 02/07/2006, I think it was always broken.

This uses defaultFromEmailAddress property in sendMail if sendFrom is missing

Thanks: Benjanmin Jugl reported, Pawan Verma fixed and others for discussion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1856667 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2019-03-31 09:14:16 +00:00
parent 95979acf0e
commit 9f36abe2c5
@@ -160,6 +160,9 @@ public class EmailServices {
}
String sendFrom = (String) context.get("sendFrom");
if (UtilValidate.isEmpty(sendFrom)) {
sendFrom = EntityUtilProperties.getPropertyValue("general", "defaultFromEmailAddress", delegator);
}
String sendType = (String) context.get("sendType");
String port = (String) context.get("port");
String socketFactoryClass = (String) context.get("socketFactoryClass");