ICEfaces
  1. ICEfaces
  2. ICE-6765

NullPointerException being thrown from DeltaSubmitParametersPropagation.handleNavigation(FacesContext, String, String) during ace:fileEntry file upload

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-2.0.0.GA, 3.0
    • Fix Version/s: EE-2.0.0.GA, 2.0.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Liferay 6.0.6 + Tomcat 6.0.29 + PortletFaces Bridge 2.0.0-SNAPSHOT (April 7th, 2011)

      Description

      Here's the patch:


      Index: core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java
      ===================================================================
      --- core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java (revision 24358)
      +++ core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java (working copy)
      @@ -51,7 +51,7 @@
       
           public void handleNavigation(FacesContext context, String fromAction, String outcome) {
               NavigationCase navigationCase = getNavigationCase(context, fromAction, outcome);
      - if (navigationCase.isRedirect()) {
      + if ((navigationCase != null) && (navigationCase.isRedirect())) {
                   handler.handleNavigation(context, fromAction, outcome);
               } else {
                   UIViewRoot viewRoot = context.getViewRoot();
      @@ -63,7 +63,13 @@
                       viewAttributes.put(DeltaSubmitPhaseListener.PreviousParameters, idToPreviousParametersMapping);
                   }
                   for (UIForm form: forms) {
      - idToPreviousParametersMapping.put(form.getId(), new HashMap((Map) form.getAttributes().get(DeltaSubmitPhaseListener.PreviousParameters)));
      + Map<String, Object> formAttributes = form.getAttributes();
      + if (formAttributes != null) {
      + Map previousParametersMap = (Map) formAttributes.get(DeltaSubmitPhaseListener.PreviousParameters);
      + if (previousParametersMap != null) {
      + idToPreviousParametersMapping.put(form.getId(), new HashMap(previousParametersMap));
      + }
      + }
                   }
                   handler.handleNavigation(context, fromAction, outcome);
                   //propagate previously calculated submit parameters

        Activity

        Hide
        Deryk Sinotte added a comment -

        Mircea,

        Please review Neil's patch and provide feedback/adjustments/etc. I've applied the patch locally and run some tests on our ACE components in Liferay 5 and this clears up a bunch of NullPointerExceptions we were seeing when running the ACE Showcase Portlets demo.

        Show
        Deryk Sinotte added a comment - Mircea, Please review Neil's patch and provide feedback/adjustments/etc. I've applied the patch locally and run some tests on our ACE components in Liferay 5 and this clears up a bunch of NullPointerExceptions we were seeing when running the ACE Showcase Portlets demo.
        Hide
        Mircea Toma added a comment -

        Let decorated navigation handler handle missing navigation cases (case==null). Test for the existence of previous parameters in form's attribute map before propagating them to the next view.

        Show
        Mircea Toma added a comment - Let decorated navigation handler handle missing navigation cases (case==null). Test for the existence of previous parameters in form's attribute map before propagating them to the next view.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Neil Griffin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: