incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1603884 - /sling/trunk/contrib/crankstart/core/src/main/java/org/apache/sling/crankstart/core/CrankstartFileProcessor.java
Date Thu, 19 Jun 2014 14:07:43 GMT
Author: bdelacretaz
Date: Thu Jun 19 14:07:42 2014
New Revision: 1603884

URL: http://svn.apache.org/r1603884
Log:
Avoid NPE

Modified:
    sling/trunk/contrib/crankstart/core/src/main/java/org/apache/sling/crankstart/core/CrankstartFileProcessor.java

Modified: sling/trunk/contrib/crankstart/core/src/main/java/org/apache/sling/crankstart/core/CrankstartFileProcessor.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/crankstart/core/src/main/java/org/apache/sling/crankstart/core/CrankstartFileProcessor.java?rev=1603884&r1=1603883&r2=1603884&view=diff
==============================================================================
--- sling/trunk/contrib/crankstart/core/src/main/java/org/apache/sling/crankstart/core/CrankstartFileProcessor.java
(original)
+++ sling/trunk/contrib/crankstart/core/src/main/java/org/apache/sling/crankstart/core/CrankstartFileProcessor.java
Thu Jun 19 14:07:42 2014
@@ -149,8 +149,10 @@ public class CrankstartFileProcessor imp
         extensionCommands.clear();
         final BundleContext bc = crankstartContext.getOsgiFramework().getBundleContext();
         final ServiceReference [] refs = bc.getServiceReferences(CrankstartCommand.class.getName(),
null);
-        for(ServiceReference ref : refs) {
-            extensionCommands.add((CrankstartCommand)bc.getService(ref));
+        if(refs != null) {
+            for(ServiceReference ref : refs) {
+                extensionCommands.add((CrankstartCommand)bc.getService(ref));
+            }
         }
         log.info("Reloaded extension commands: {}", getDescriptions(extensionCommands));
     }



Mime
View raw message