[FELIX-4642] NPE in the resolver when substituting

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1625895 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java b/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
index 6ada758..230912a 100644
--- a/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
+++ b/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
@@ -1520,7 +1520,7 @@
             for (Candidates existingPerm : permutations)
             {
                 List<Capability> existingPermCands = existingPerm.getCandidates(req);
-                if (!existingPermCands.get(0).equals(candidates.get(0)))
+                if (existingPermCands != null && !existingPermCands.get(0).equals(candidates.get(0)))
                 {
                     permutated = true;
                 }