You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2019/05/20 04:22:55 UTC

[karaf] branch master updated: [KARAF-6252] Avoid NullPointerException while removing a features repository with location changed locally

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

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/karaf.git


The following commit(s) were added to refs/heads/master by this push:
     new c892504  [KARAF-6252] Avoid NullPointerException while removing a features repository with location changed locally
     new 78ead5e  Merge pull request #845 from jbonofre/KARAF-6252
c892504 is described below

commit c892504ac9a9eafaf01e2d8bbe90c88bc4f86541
Author: Jean-Baptiste Onofré <jb...@apache.org>
AuthorDate: Sun May 19 07:35:43 2019 +0200

    [KARAF-6252] Avoid NullPointerException while removing a features repository with location changed locally
---
 .../apache/karaf/features/internal/service/FeaturesServiceImpl.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
index 066f721..1924973 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
@@ -423,7 +423,11 @@ public class FeaturesServiceImpl implements FeaturesService, Deployer.DeployCall
             for (String r : state.repositories) {
                 if (!uri.toString().equals(r)) {
                     Repository rep = repositories.getRepository(r);
-                    repos.addAll(repositories.getRepositoryClosure(rep));
+                    if (rep != null) {
+                        repos.addAll(repositories.getRepositoryClosure(rep));
+                    } else {
+                        throw new IllegalArgumentException("Repository URI " + uri + " seems to have changed, can't remove repository");
+                    }
                 }
             }
             for (Repository rep : repos) {