[ https://issues.apache.org/jira/browse/ISIS-2066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood closed ISIS-2066. ----------------------------- > Invoking an action that returns null results in an NPE ... eg > HelloWorldObject#delete(). > ---------------------------------------------------------------------------------------- > > Key: ISIS-2066 > URL: https://issues.apache.org/jira/browse/ISIS-2066 > Project: Isis > Issue Type: Bug > Reporter: Dan Haywood > Assignee: Dan Haywood > Priority: Major > Fix For: 2.0.0-M2 > > > this stackt trace: > {code:java} > Stack trace: > java.lang.NullPointerException > java.util.Objects#requireNonNull(Objects.java:203) > java.util.Optional#<init>(Optional.java:96) > java.util.Optional#of(Optional.java:108) > java.util.stream.FindOps$FindSink$OfRef#get(FindOps.java:193) > java.util.stream.FindOps$FindSink$OfRef#get(FindOps.java:190) > java.util.stream.FindOps$FindOp#evaluateSequential(FindOps.java:152) > java.util.stream.AbstractPipeline#evaluate(AbstractPipeline.java:234) > java.util.stream.ReferencePipeline#findFirst(ReferencePipeline.java:464) > org.apache.isis.viewer.wicket.model.models.ActionModel#executeAction(ActionModel.java:474){code} > > which results from this code: > {code:java} > return routingServices > .filter(routingService->routingService.canRoute(result)) > .map(routingService->{ > final Object routeTo = routingService.route(result); > return routeTo != null? getPersistenceSession().adapterFor(routeTo): > null; > }) > .findFirst() > .orElse(resultAdapter); > {code} > > This isn't quite equivalent to the code in 1.16.x: > {code:java} > final Object result = resultAdapter != null ? resultAdapter.getObject() : > null; > for (RoutingService routingService : routingServices) { > final boolean canRoute = routingService.canRoute(result); > if(canRoute) { > final Object routeTo = routingService.route(result); > return routeTo != null? getPersistenceSession().adapterFor(routeTo): > null; > } > } > return resultAdapter; > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)