Author: byersa
Date: Tue Sep 25 13:39:33 2007
New Revision: 579373
URL:
http://svn.apache.org/viewvc?rev=579373&view=revLog:
Fixing a really lame bug that I introduced.
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=579373&r1=579372&r2=579373&view=diff==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/content/ContentWorker.java Tue Sep 25 13:39:33 2007
@@ -113,6 +113,10 @@
public static void renderContentAsText(LocalDispatcher dispatcher, GenericDelegator delegator, String contentId, Writer out,
Map templateContext, Locale locale, String mimeTypeId, boolean cache) throws GeneralException, IOException {
GenericValue content;
+ if (UtilValidate.isEmpty(contentId)) {
+ Debug.logError("No content ID found.", module);
+ return;
+ }
if (cache) {
content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentId));
} else {
@@ -178,6 +182,10 @@
String templateDataResourceId = content.getString("templateDataResourceId");
String dataResourceId = content.getString("dataResourceId");
contentId = content.getString("contentId");
+ if (UtilValidate.isEmpty(contentId)) {
+ Debug.logError("No dataResourceId found.", module);
+ return;
+ }
if (templateContext == null) {
templateContext = FastMap.newInstance();
@@ -216,6 +224,10 @@
// now if no template; just render the data
if (UtilValidate.isEmpty(templateDataResourceId) || templateContext.containsKey("ignoreTemplate")) {
+ if (UtilValidate.isEmpty(contentId)) {
+ Debug.logError("No content ID found.", module);
+ return;
+ }
DataResourceWorker.renderDataResourceAsText(delegator, dataResourceId, out, templateContext, locale, mimeTypeId, cache);
// there is a template; render the data and then the template