You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2008/07/23 21:41:12 UTC

svn commit: r679168 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

Author: adrianc
Date: Wed Jul 23 12:41:12 2008
New Revision: 679168

URL: http://svn.apache.org/viewvc?rev=679168&view=rev
Log:
Fixed bug in EmailServices.java where it assumed optional parameters existed.

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java?rev=679168&r1=679167&r2=679168&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java Wed Jul 23 12:41:12 2008
@@ -322,15 +322,20 @@
         String bodyScreenUri = (String) serviceContext.remove("bodyScreenUri");
         String xslfoAttachScreenLocation = (String) serviceContext.remove("xslfoAttachScreenLocation");
         String attachmentName = (String) serviceContext.remove("attachmentName");
-        Map bodyParameters = (Map) serviceContext.remove("bodyParameters");
         Locale locale = (Locale) serviceContext.get("locale");
+        Map bodyParameters = (Map) serviceContext.remove("bodyParameters");
+        if (bodyParameters == null) {
+            bodyParameters = MapStack.create();
+        }
         if (!bodyParameters.containsKey("locale")) {
             bodyParameters.put("locale", locale);
         } else {
             locale = (Locale) bodyParameters.get("locale");
         }
         String partyId = (String) bodyParameters.get("partyId");
-        NotificationServices.setBaseUrl(dctx.getDelegator(), webSiteId, bodyParameters);
+        if (UtilValidate.isNotEmpty(webSiteId)) {
+            NotificationServices.setBaseUrl(dctx.getDelegator(), webSiteId, bodyParameters);
+        }
         String contentType = (String) serviceContext.remove("contentType");
 
         if (UtilValidate.isEmpty(attachmentName)) {
@@ -368,7 +373,7 @@
         
         boolean isMultiPart = false;
         
-        // check if attachement screen location passed in
+        // check if attachment screen location passed in
         if (UtilValidate.isNotEmpty(xslfoAttachScreenLocation)) {
             isMultiPart = true;
             // start processing fo pdf attachment