Author: sichen
Date: Wed Jul 5 17:50:47 2006
New Revision: 419399
URL:
http://svn.apache.org/viewvc?rev=419399&view=revLog:
Added check for null product in getProductContentAsText. If Product null, return null.
Modified:
incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java
Modified: incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java?rev=419399&r1=419398&r2=419399&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java (original)
+++ incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java Wed Jul 5 17:50:47 2006
@@ -93,6 +93,10 @@
}
public static String getProductContentAsText(GenericValue product, String productContentTypeId, Locale locale, String mimeTypeId, GenericDelegator delegator) {
+ if (product == null) {
+ return null;
+ }
+
String candidateFieldName = ModelUtil.dbNameToVarName(productContentTypeId);
/* caching: there is one cache created, "product.content" Each product's content is cached with a key of
* contentTypeId::locale::mimeType::productId, or whatever the SEPARATOR is defined above to be.