You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2018/02/03 12:34:50 UTC

[isis] 02/03: ISIS-1822: further NPE fix.

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

danhaywood pushed a commit to branch maint-1.16.1
in repository https://gitbox.apache.org/repos/asf/isis.git

commit 687840765a3ac79738bf820cda1806f050680141
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Feb 3 12:23:14 2018 +0000

    ISIS-1822: further NPE fix.
---
 .../components/actionmenu/serviceactions/ServiceActionUtil.java   | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/serviceactions/ServiceActionUtil.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/serviceactions/ServiceActionUtil.java
index c4bdca4..f31cb57 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/serviceactions/ServiceActionUtil.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/actionmenu/serviceactions/ServiceActionUtil.java
@@ -37,6 +37,8 @@ import org.apache.wicket.markup.html.list.ListItem;
 import org.apache.wicket.markup.html.list.ListView;
 import org.apache.wicket.markup.html.panel.Fragment;
 import org.apache.wicket.model.Model;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.isis.applib.layout.component.ServiceActionLayoutData;
 import org.apache.isis.applib.layout.menubars.MenuBars;
@@ -64,6 +66,8 @@ import de.agilecoders.wicket.extensions.markup.html.bootstrap.confirmation.Confi
 
 public final class ServiceActionUtil {
 
+    private final static Logger LOG = LoggerFactory.getLogger(ServiceActionUtil.class);
+
     private ServiceActionUtil(){}
 
     static void addLeafItem(
@@ -241,6 +245,10 @@ public final class ServiceActionUtil {
                     final EntityModel entityModel = new EntityModel(serviceAdapter);
                     final ObjectAction objectAction = serviceAdapter.getSpecification()
                             .getObjectAction(actionLayoutData.getId());
+                    if(objectAction == null) {
+                        LOG.warn("No such action {}", actionLayoutData.getId());
+                        continue;
+                    }
                     final ServiceAndAction serviceAndAction =
                             new ServiceAndAction(actionLayoutData.getNamed(), entityModel, objectAction);
 

-- 
To stop receiving notification emails like this one, please contact
danhaywood@apache.org.