svn commit: r571470 - /lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: rfrovarp
Date: Fri Aug 31 07:04:03 2007
New Revision: 571470

URL: http://svn.apache.org/viewvc?rev=571470&view=rev
Log:
Fixed possible NPE.

Modified:
    lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java

Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java?rev=571470&r1=571469&r2=571470&view=diff
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java (original)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/PublicationManagerImpl.java Fri Aug 31 07:04:03 2007
@@ -148,13 +148,14 @@
     }
 
     public void addPublication(String pubId) throws PublicationException {
-        if (this.id2config.containsKey(pubId)) {
+        Map id2config = getId2config();
+        if (id2config.containsKey(pubId)) {
             throw new PublicationException("The publication [" + pubId + "] already exists.");
         }
         PublicationConfiguration config = new PublicationConfiguration(pubId,
                 this.servletContextPath);
         ContainerUtil.enableLogging(config, getLogger());
-        this.id2config.put(pubId, config);
+        id2config.put(pubId, config);
     }
 
     protected String getServletContextPath() {
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.