camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1458534 - /camel/trunk/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageMojo.java
Date Tue, 19 Mar 2013 21:57:19 GMT
Author: dkulp
Date: Tue Mar 19 21:57:19 2013
New Revision: 1458534

URL: http://svn.apache.org/r1458534
Log:
Fix potential NPE

Modified:
    camel/trunk/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageMojo.java

Modified: camel/trunk/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageMojo.java
URL: http://svn.apache.org/viewvc/camel/trunk/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageMojo.java?rev=1458534&r1=1458533&r2=1458534&view=diff
==============================================================================
--- camel/trunk/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageMojo.java
(original)
+++ camel/trunk/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PackageMojo.java
Tue Mar 19 21:57:19 2013
@@ -81,16 +81,18 @@ public class PackageMojo extends Abstrac
             }
             f = new File(f, "META-INF/services/org/apache/camel/component");
             
-            if (f.exists()) {
+            if (f.exists() && f.isDirectory()) {
                 File[] files = f.listFiles();
-                for (File file : files) {
-                    String name = file.getName();
-                    if (name.charAt(0) != '.') {
-                        count++;
-                        if (buffer.length() > 0) {
-                            buffer.append(" ");
+                if (files != null) {
+                    for (File file : files) {
+                        String name = file.getName();
+                        if (name.charAt(0) != '.') {
+                            count++;
+                            if (buffer.length() > 0) {
+                                buffer.append(" ");
+                            }
+                            buffer.append(name);
                         }
-                        buffer.append(name);
                     }
                 }
             }



Mime
View raw message