lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication DefaultDocument.java
Date Wed, 13 Aug 2003 15:05:59 GMT
egli        2003/08/13 08:05:59

  Modified:    src/java/org/apache/lenya/cms/publication
                        DefaultDocument.java
  Log:
  Fix a nullPointerException by querying the node for != null
  before asking it for it's languages.
  
  Revision  Changes    Path
  1.25      +7 -4      cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultDocument.java
  
  Index: DefaultDocument.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DefaultDocument.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- DefaultDocument.java	13 Aug 2003 09:57:31 -0000	1.24
  +++ DefaultDocument.java	13 Aug 2003 15:05:59 -0000	1.25
  @@ -187,9 +187,12 @@
           SiteTree sitetree;
           try {
               sitetree = getPublication().getSiteTree(getArea());
  -            Label[] labels = sitetree.getNode(getId()).getLabels();
  -            for (int i = 0; i < labels.length; i++) {
  -                languages.add(labels[i].getLanguage());
  +            SiteTreeNode node = sitetree.getNode(getId());
  +            if (node != null) {
  +                Label[] labels = node.getLabels();
  +                for (int i = 0; i < labels.length; i++) {
  +                    languages.add(labels[i].getLanguage());
  +                }
               }
           } catch (SiteTreeException e) {
               throw new DocumentException(e);
  
  
  

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


Mime
View raw message