jford       2004/09/07 12:59:12

  Modified:    applications/pam/src/java/org/apache/jetspeed/portlets/pam
                        PortletApplicationBrowser.java
  Log:
  Check for null node
  
  Revision  Changes    Path
  1.8       +23 -21    
jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java
  
  Index: PortletApplicationBrowser.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/applications/pam/src/java/org/apache/jetspeed/portlets/pam/PortletApplicationBrowser.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PortletApplicationBrowser.java    3 Sep 2004 19:35:50 -0000       1.7
  +++ PortletApplicationBrowser.java    7 Sep 2004 19:59:11 -0000       1.8
  @@ -87,28 +87,30 @@
        {
                TreeControl control = (TreeControl) 
actionRequest.getPortletSession().getAttribute("j2_tree");
                //assert control != null
  -             
  -             String node = actionRequest.getParameter("node");
  -             if(node != null)
  +             if(control != null)
                {
  -                 TreeControlNode controlNode = control.findNode(node);
  -                 if(controlNode != null)
  -                 {
  -                     controlNode.setExpanded(!controlNode.isExpanded());
  -                 }
  +                     String node = actionRequest.getParameter("node");
  +                     if(node != null)
  +                     {
  +                         TreeControlNode controlNode = control.findNode(node);
  +                         if(controlNode != null)
  +                         {
  +                             controlNode.setExpanded(!controlNode.isExpanded());
  +                         }
  +                     }
  +                     
  +                     String selectedNode = 
actionRequest.getParameter(PortletApplicationResources.REQUEST_SELECT_NODE);
  +                     if(selectedNode != null)
  +                     {
  +                         control.selectNode(selectedNode);
  +                 MutablePortletApplication pa = 
registry.getPortletApplicationByIdentifier(selectedNode);
  +                 if (null != pa)
  +                 {
  +                     
actionRequest.getPortletSession().setAttribute(PortletApplicationResources.PAM_CURRENT_PA,
 pa, PortletSession.APPLICATION_SCOPE);
  +                     
actionRequest.getPortletSession().removeAttribute(PortletApplicationResources.REQUEST_SELECT_PORTLET,
 PortletSession.APPLICATION_SCOPE);
  +                 }
  +                     }
                }
  -             
  -             String selectedNode = 
actionRequest.getParameter(PortletApplicationResources.REQUEST_SELECT_NODE);
  -             if(selectedNode != null)
  -             {
  -                 control.selectNode(selectedNode);
  -            MutablePortletApplication pa = 
registry.getPortletApplicationByIdentifier(selectedNode);
  -            if (null != pa)
  -            {
  -                
actionRequest.getPortletSession().setAttribute(PortletApplicationResources.PAM_CURRENT_PA,
 pa, PortletSession.APPLICATION_SCOPE);
  -                
actionRequest.getPortletSession().removeAttribute(PortletApplicationResources.REQUEST_SELECT_PORTLET,
 PortletSession.APPLICATION_SCOPE);
  -            }
  -             }       
        }
        
        private TreeControl buildTree(List apps) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to