svn commit: r570146 - /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Mon Aug 27 07:49:47 2007
New Revision: 570146

URL: http://svn.apache.org/viewvc?rev=570146&view=rev
Log:
Avoid NPE in PageEnvelopeModule for non-publication URLs

Modified:
    lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java

Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java?rev=570146&r1=570145&r2=570146&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/components/modules/input/PageEnvelopeModule.java Mon Aug 27 07:49:47 2007
@@ -76,7 +76,8 @@
             } else if (name.equals(PageEnvelope.IS_PUBLICATION)) {
                 value = Boolean.toString(envelope.getPublication() != null);
             } else if (name.equals(PageEnvelope.PUBLICATION_ID)) {
-                value = envelope.getPublication().getId();
+                Publication pub = envelope.getPublication();
+                value = pub != null ? pub.getId() : "";
             } else if (name.equals(PageEnvelope.PUBLICATION)) {
                 value = envelope.getPublication();
             } else if (name.equals(PageEnvelope.PUBLICATION_LANGUAGES_CSV)) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.