Ray Milkey
Committed by Gerrit Code Review

Recover from NPE that can sometimes be thrown by Felix

Change-Id: Ib9415df4708dc1265edfdaf4168bd29eb0805614
...@@ -94,9 +94,16 @@ public class ComponentsMonitor { ...@@ -94,9 +94,16 @@ public class ComponentsMonitor {
94 } 94 }
95 95
96 private boolean isFullyStarted(Feature feature) { 96 private boolean isFullyStarted(Feature feature) {
97 - return feature.getBundles().stream() 97 + try {
98 - .map(info -> bundleContext.getBundle(info.getLocation())) 98 + return feature.getBundles().stream()
99 - .allMatch(this::isFullyStarted); 99 + .map(info -> bundleContext.getBundle(info.getLocation()))
100 + .allMatch(this::isFullyStarted);
101 + } catch (NullPointerException npe) {
102 + // FIXME: Remove this catch block when Felix fixes the bug
103 + // Due to a bug in the Felix implementation, this can throw an NPE.
104 + // Catch the error and do something sensible with it.
105 + return false;
106 + }
100 } 107 }
101 108
102 private boolean isFullyStarted(Bundle bundle) { 109 private boolean isFullyStarted(Bundle bundle) {
......