portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raph...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit JetspeedPortalToolkitService.java
Date Mon, 04 Jun 2001 19:42:33 GMT
raphael     01/06/04 12:42:33

  Modified:    src/java/org/apache/jetspeed/services/portaltoolkit
                        JetspeedPortalToolkitService.java
  Log:
  [fix] prevent a NPE from occuring when no portlet is returned by the
  PortletFactory
  
  Revision  Changes    Path
  1.3       +11 -7     jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java
  
  Index: JetspeedPortalToolkitService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/services/portaltoolkit/JetspeedPortalToolkitService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JetspeedPortalToolkitService.java	2001/06/04 18:57:43	1.2
  +++ JetspeedPortalToolkitService.java	2001/06/04 19:42:33	1.3
  @@ -81,7 +81,7 @@
    * Simple implementation of the PortalFactoryService.
    * 
    * @author <a href="mailto:raphael@apache.org">RaphaŽl Luta</a>
  - * @version $Id: JetspeedPortalToolkitService.java,v 1.2 2001/06/04 18:57:43 raphael Exp
$
  + * @version $Id: JetspeedPortalToolkitService.java,v 1.3 2001/06/04 19:42:33 raphael Exp
$
    */
   public class JetspeedPortalToolkitService extends TurbineBaseService
       implements PortalToolkitService
  @@ -388,14 +388,18 @@
                   if ( entry != null )
                   {
                       Portlet p = PortletFactory.getPortlet( entries[i] );
  -                    Map constraints = getParameters(entries[i].getLayout());
  -                    int position = getPosition( entries[i].getLayout() );
                       
  -                    PortletControl control =  getControl(entries[i].getControl());
  +                    if (p != null)
  +                    {
  +                        Map constraints = getParameters(entries[i].getLayout());
  +                        int position = getPosition( entries[i].getLayout() );
                       
  -                    set.addPortlet( initControl(control,p),
  -                                    controller.getConstraints( constraints ),
  -                                    position );
  +                        PortletControl control =  getControl(entries[i].getControl());
  +                    
  +                        set.addPortlet( initControl(control,p),
  +                                        controller.getConstraints( constraints ),
  +                                        position );
  +                    }
                   }
                   else 
                   {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message