You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by jo...@apache.org on 2006/04/12 17:40:56 UTC

svn commit: r393488 - /lenya/branches/BRANCH_1_2_X/src/webapp/lenya/content/info/overview.xsp

Author: josias
Date: Wed Apr 12 08:40:54 2006
New Revision: 393488

URL: http://svn.apache.org/viewcvs?rev=393488&view=rev
Log:
don't throw an NPE on the authoring, trash, or archive nodes, which don't have any labels

Modified:
    lenya/branches/BRANCH_1_2_X/src/webapp/lenya/content/info/overview.xsp

Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/content/info/overview.xsp
URL: http://svn.apache.org/viewcvs/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/content/info/overview.xsp?rev=393488&r1=393487&r2=393488&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/content/info/overview.xsp (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/content/info/overview.xsp Wed Apr 12 08:40:54 2006
@@ -34,6 +34,7 @@
     <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
     <xsp:include>org.apache.lenya.cms.publication.DefaultDocumentBuilder</xsp:include>
     <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
+    <xsp:include>org.apache.lenya.cms.publication.Label</xsp:include>
     <xsp:include>org.apache.lenya.cms.publication.DocumentException</xsp:include>
     <xsp:include>org.apache.lenya.cms.publication.SiteTreeException</xsp:include>
     <xsp:include>org.apache.lenya.cms.publication.xsp.DocumentLanguagesHelper</xsp:include>
@@ -48,12 +49,13 @@
       String identifier = null; 
       final Document doc = (Document)<input:get-attribute module="page-envelope" as="object" name="document"/>;
       String visibility = "visible";
-      String href = "";
+      String href = null;
       
       try {
           SiteTreeNode node = doc.getPublication().getTree(doc.getArea()).getNode(doc.getId());
           if (!node.visibleInNav()) visibility = "hidden";
-          href = node.getLabel(doc.getLanguage()).getHref();
+          Label label = node.getLabel(doc.getLanguage());
+          if (label != null) href = label.getHref();
           if (href == null) href = "";
       } catch(SiteTreeException e) {
           throw new ProcessingException(e);



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org