Author: jacopoc
Date: Fri Apr 20 21:42:51 2007
New Revision: 530980
URL:
http://svn.apache.org/viewvc?view=rev&rev=530980Log:
Applied patch from Guido Amarilla (OFBIZ-912) with checks to prevent NPE for null arrays of CC and BCC addresses.
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?view=diff&rev=530980&r1=530979&r2=530980==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java Fri Apr 20 21:42:51 2007
@@ -832,11 +832,15 @@
for (int x = 0 ; x < addressesTo.length ; x++) {
emailAddressesTo.add(((InternetAddress) addressesTo[x]).getAddress());
}
- for (int x = 0 ; x < addressesCC.length ; x++) {
- emailAddressesCC.add(((InternetAddress) addressesCC[x]).getAddress());
+ if (addressesCC != null) {
+ for (int x = 0 ; x < addressesCC.length ; x++) {
+ emailAddressesCC.add(((InternetAddress) addressesCC[x]).getAddress());
+ }
}
- for (int x = 0 ; x < addressesBCC.length ; x++) {
- emailAddressesBCC.add(((InternetAddress) addressesBCC[x]).getAddress());
+ if (addressesBCC != null) {
+ for (int x = 0 ; x < addressesBCC.length ; x++) {
+ emailAddressesBCC.add(((InternetAddress) addressesBCC[x]).getAddress());
+ }
}
String fromString = StringUtil.join(UtilMisc.toList(emailAddressesFrom), ",");
String toString = StringUtil.join(UtilMisc.toList(emailAddressesTo), ",");