You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2022/07/01 15:38:48 UTC

[ofbiz-framework] branch trunk updated: Fixed: MenuItem doesn't follow correctly extended informations (OFBIZ-12628)

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

nmalin 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 7ea371bde3 Fixed: MenuItem doesn't follow correctly extended informations (OFBIZ-12628)
7ea371bde3 is described below

commit 7ea371bde3c06d6ae7f86b13a755672f92764aaf
Author: Nicolas Malin <ni...@nereide.fr>
AuthorDate: Fri Jul 1 17:35:17 2022 +0200

    Fixed: MenuItem doesn't follow correctly extended informations (OFBIZ-12628)
    
    Fix a null pointer exception when the extended menu have an entry without link.
    
    Thanks to Jacques Leroux for the alert
---
 .../src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java
index 5c54bb3225..3ebb034b66 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelMenuItem.java
@@ -691,7 +691,9 @@ public class ModelMenuItem extends ModelWidget {
 
         public MenuLink(MenuLink originLink, ModelMenuItem parentMenuItem) {
             this.linkMenuItem = parentMenuItem;
-            this.link = originLink.link;
+            this.link = originLink != null
+                    ? originLink.link
+                    : null;
         }
 
         public MenuLink(GenericValue portalPage, ModelMenuItem parentMenuItem, Locale locale) {