You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/07/28 09:33:04 UTC

svn commit: r225722 - /cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java

Author: cziegeler
Date: Thu Jul 28 00:33:01 2005
New Revision: 225722

URL: http://svn.apache.org/viewcvs?rev=225722&view=rev
Log:
fix npe

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java?rev=225722&r1=225721&r2=225722&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/core/CoreUtil.java Thu Jul 28 00:33:01 2005
@@ -758,9 +758,19 @@
      * of this class (eg. Cocoon Context).
      */
     protected void updateEnvironment() throws Exception {
-        StringBuffer buffer = new StringBuffer(this.env.getClassPath(this.settings));
-        buffer.append(File.pathSeparatorChar).append(this.getExtraClassPath());
-
+        // concatenate the class path and the extra class path
+        String classPath = this.env.getClassPath(this.settings);
+        StringBuffer buffer = new StringBuffer();
+        if ( classPath != null && classPath.length() > 0 ) {
+            buffer.append(classPath);
+        }
+        classPath = this.getExtraClassPath();
+        if ( classPath != null && classPath.length() > 0 ) {
+            if ( buffer.length() > 0 ) {
+                buffer.append(File.pathSeparatorChar);
+            }
+            buffer.append(classPath);
+        }
         this.appContext.put(Constants.CONTEXT_CLASSPATH, buffer.toString());
     }