This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 6b2111cfe0 Fixed: Trunk demo errors in error.log (OFBIZ-13005)
6b2111cfe0 is described below

commit 6b2111cfe098196ac08d4c7959956babaa2fefa9
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Thu Jun 27 09:18:16 2024 +0200

    Fixed: Trunk demo errors in error.log (OFBIZ-13005)
    
    Disclaimer: Jira is off at the moment so I did not create a new issue for 
this
    trivial issue. I found this error:
    
    2024-06-27 02:51:46,355 |-0.0.0.0-8009-exec-4 |ControlServlet
    |E| Error in request handler:
    java.lang.IllegalArgumentException: Error running script at location
    [component://order/src/main/groovy/org/apache/ofbiz/order/entry/
    catalog/Product.groovy]: java.lang.NullPointerException
    [...]
    at org.apache.ofbiz.order.entry.catalog.Product.run(Product.groovy:125)
    
    Here is the only fix I can think about.
---
 .../groovy/org/apache/ofbiz/order/entry/catalog/Product.groovy | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/catalog/Product.groovy
 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/catalog/Product.groovy
index f455e344df..d50109f8a1 100644
--- 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/catalog/Product.groovy
+++ 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/entry/catalog/Product.groovy
@@ -20,12 +20,12 @@ package org.apache.ofbiz.order.entry.catalog
 
 import org.apache.ofbiz.base.util.StringUtil
 import org.apache.ofbiz.base.util.UtilHttp
+import org.apache.ofbiz.entity.util.EntityUtil
 import org.apache.ofbiz.product.catalog.CatalogWorker
-import org.apache.ofbiz.product.category.CategoryWorker
 import org.apache.ofbiz.product.category.CategoryContentWrapper
-import org.apache.ofbiz.product.product.ProductWorker
+import org.apache.ofbiz.product.category.CategoryWorker
 import org.apache.ofbiz.product.product.ProductContentWrapper
-import org.apache.ofbiz.entity.util.EntityUtil
+import org.apache.ofbiz.product.product.ProductWorker
 
 contentPathPrefix = CatalogWorker.getContentPathPrefix(request)
 catalogName = CatalogWorker.getCatalogName(request)
@@ -122,7 +122,9 @@ if (productId) {
                     }
                 }
             }
-            context.metaKeywords = StringUtil.join(keywords, ', ')
+            if (keywords) {
+                context.metaKeywords = StringUtil.join(keywords, ', ')
+            }
         }
 
         // Set the default template for aggregated product (product component 
configurator ui)

Reply via email to