cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r491411 - /cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
Date Sun, 31 Dec 2006 12:03:45 GMT
Author: danielf
Date: Sun Dec 31 04:03:44 2006
New Revision: 491411

URL: http://svn.apache.org/viewvc?view=rev&rev=491411
Log:
Avoid NPE in non Maven context (e.g. Eclipse).

Modified:
    cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java

Modified: cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java?view=diff&rev=491411&r1=491410&r2=491411
==============================================================================
--- cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
(original)
+++ cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/ResourceUtils.java
Sun Dec 31 04:03:44 2006
@@ -203,7 +203,10 @@
         final String resourceName = "META-INF/maven/" + groupId + "/" + versionId + "/pom.properties";
         try {
             final Properties p = new Properties();
-            p.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName));
+            final InputStream resourceAsStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourceName);
+            if (resourceAsStream == null)
+                return null;
+            p.load(resourceAsStream);
             return p;
         } catch (IOException ignore) {
             return null;



Mime
View raw message