svn commit: r644484 - /lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: rfrovarp
Date: Thu Apr  3 13:47:43 2008
New Revision: 644484

URL: http://svn.apache.org/viewvc?rev=644484&view=rev
Log:
Avoid NPE when there is no parent.

Modified:
    lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java

Modified: lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java?rev=644484&r1=644483&r2=644484&view=diff
==============================================================================
--- lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java (original)
+++ lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/CreateDocument.java Thu Apr  3 13:47:43 2008
@@ -55,6 +55,7 @@
         if (parent == null) {
             setParameter(PARENT_PATH, "");
         } else {
+            setParameter(LANGUAGE,parent.getLanguage());
             try {
                 setParameter(PARENT_PATH, parent.getPath());
             } catch (DocumentException e) {
@@ -67,7 +68,6 @@
             addErrorMessage("The publication doesn't contain any languages!");
         }
         setParameter(LANGUAGES, languages);
-        setParameter(LANGUAGE,parent.getLanguage());
 
         Document sourceDoc = getSourceDocument();
         String[] childOnly = { RELATION_CHILD };
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.