Details
Description
When entering a flow while using a custom navigation handler, the following NPE occur:
java.lang.NullPointerException org.apache.myfaces.application.NavigationHandlerImpl.getNavigationCaseFromFlowStructure(NavigationHandlerImpl.java:958) org.apache.myfaces.application.NavigationHandlerImpl.getNavigationCommand(NavigationHandlerImpl.java:773) org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:133) org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:121) org.primefaces.application.DialogNavigationHandler.handleNavigation(DialogNavigationHandler.java:113) org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:140) org.primefaces.application.DialogActionListener.processAction(DialogActionListener.java:54) javax.faces.component.UICommand.broadcast(UICommand.java:120) javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1255) javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:420) javax.faces.component.UIViewRoot._process(UIViewRoot.java:1741) javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:935) org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:42) org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:195) org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:142) javax.faces.webapp.FacesServlet.service(FacesServlet.java:204)
My testing used the "org.primefaces.application.DialogNavigationHandler" (link) from PrimeFaces.
______
Typically, the Flow navigations would be added here in NavigationHandlerImpl#inspectFlow: https://github.com/apache/myfaces/blob/2.3.x/impl/src/main/java/org/apache/myfaces/application/NavigationHandlerImpl.java#L1490-L1492
However, since DialogNavigationHandler is a sub class of ConfigurableNavigationHandler, the inspectFlow (empty method) is called on the super class instead. See methods here:
Since _flowNavigationStructureMap is empty, an null (from the get call) is passed into getNavigationCaseFromFlowStructure which causes the NPE.