You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:52:29 UTC

[sling-org-apache-sling-launchpad-installer] 07/10: Add extra null checks

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.launchpad.installer-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-installer.git

commit ed24c0628f7aa793b0435d730db3b4558e3ec74e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jan 31 13:12:07 2011 +0000

    Add extra null checks
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/launchpad/installer@1065593 13f79535-47bb-0310-9956-ffa450edef68
---
 .../installer/impl/LaunchpadConfigInstaller.java   | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
index c2f6435..1455d1d 100644
--- a/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
+++ b/src/main/java/org/apache/sling/launchpad/installer/impl/LaunchpadConfigInstaller.java
@@ -53,20 +53,24 @@ public class LaunchpadConfigInstaller {
 
         // configurations
         final Iterator<String> configPaths = resourceProvider.getChildren(ROOT_CONFIG_PATH);
-        while (configPaths.hasNext()) {
-            final String path = configPaths.next();
-            logger.info("Config launchpad file will be installed: {}", path);
-            final InputStream stream = resourceProvider.getResourceAsStream(path);
-            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, null));
+        if ( configPaths != null ) {
+            while (configPaths.hasNext()) {
+                final String path = configPaths.next();
+                logger.info("Config launchpad file will be installed: {}", path);
+                final InputStream stream = resourceProvider.getResourceAsStream(path);
+                installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_PROPERTIES, null));
+            }
         }
 
         // files
         final Iterator<String> filePaths = resourceProvider.getChildren(ROOT_INSTALL_PATH);
-        while (filePaths.hasNext()) {
-            final String path = filePaths.next();
-            logger.info("Launchpad file will be installed: {}", path);
-            final InputStream stream = resourceProvider.getResourceAsStream(path);
-            installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_FILE, null));
+        if ( filePaths != null ) {
+            while (filePaths.hasNext()) {
+                final String path = filePaths.next();
+                logger.info("Launchpad file will be installed: {}", path);
+                final InputStream stream = resourceProvider.getResourceAsStream(path);
+                installables.add(new InstallableResource(path, stream, null, null, InstallableResource.TYPE_FILE, null));
+            }
         }
 
         final InstallableResource [] toInstall = installables.toArray(new InstallableResource []{});

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.