Author: taylor
Date: Fri Jun 22 11:15:37 2007
New Revision: 549920

URL: http://svn.apache.org/viewvc?view=rev&rev=549920
Log:
better error checking

Modified:
    
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java

Modified: 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java?view=diff&rev=549920&r1=549919&r2=549920
==============================================================================
--- 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
 (original)
+++ 
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/tools/pamanager/PortletApplicationManager.java
 Fri Jun 22 11:15:37 2007
@@ -171,8 +171,9 @@
         File webinf = new File (appRoot);
         ClassLoader contextClassLoader = 
Thread.currentThread().getContextClassLoader();        
         DirectoryHelper dir = new DirectoryHelper(webinf);
-        MutablePortletApplication app = 
registry.getPortletApplicationByIdentifier(contextName);
-        if (app.getApplicationType() == MutablePortletApplication.LOCAL)
+        String appName = (contextName.startsWith("/")) ? 
contextName.substring(1) : contextName;
+        MutablePortletApplication app = 
registry.getPortletApplicationByIdentifier(appName);
+        if (app != null && app.getApplicationType() == 
MutablePortletApplication.LOCAL)
         {
             app.setApplicationType(MutablePortletApplication.INTERNAL);
             registry.updatePortletApplication(app);



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

Reply via email to