svn commit: r419399 - /incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r419399 - /incubator/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductContentWrapper.java

sichen
Author: sichen
Date: Wed Jul  5 17:50:47 2006
New Revision: 419399

URL: http://svn.apache.org/viewvc?rev=419399&view=rev
Log:
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.