You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2021/05/19 12:24:53 UTC

[sling-org-apache-sling-feature-cpconverter] branch issues/SLING-10395 created (now e592736)

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

pauls pushed a change to branch issues/SLING-10395
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git.


      at e592736  SLING-10395: ignore empty mappings

This branch includes the following new commits:

     new e592736  SLING-10395: ignore empty mappings

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-feature-cpconverter] 01/01: SLING-10395: ignore empty mappings

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pauls pushed a commit to branch issues/SLING-10395
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-cpconverter.git

commit e592736f725ecc3434340169cd11838063d389f0
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Wed May 19 14:24:41 2021 +0200

    SLING-10395: ignore empty mappings
---
 .../sling/feature/cpconverter/features/DefaultFeaturesManager.java    | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java b/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java
index c75c7f8..f84b9e4 100644
--- a/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java
+++ b/src/main/java/org/apache/sling/feature/cpconverter/features/DefaultFeaturesManager.java
@@ -325,6 +325,10 @@ public class DefaultFeaturesManager implements FeaturesManager, PackagesEventsEm
             if (mappings != null) {
                 List<String> newMappings = new ArrayList<>();
                 for (String usermapping : mappings) {
+                    if (usermapping == null || usermapping.trim().isEmpty()) {
+                        // invalid empty mapping => ignore
+                        continue;
+                    }
                     Mapping mapping = new Mapping(usermapping, enforceServiceMappingByPrincipal);
                     getAclManager().addMapping(mapping);
                     newMappings.add(mapping.asString());