Permalink
Browse files

Aries-971: ServiceHelper.CacheClearoutListener.add(BundleContext, Ser…

…viceKey) causes NPE if system bundle is hidden

git-svn-id: https://svn.apache.org/repos/asf/aries/trunk@1413680 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 5c35e50 commit fa4f31806b06145ee484dcbcd989c1b9e342e36f Mark Nuttall committed Nov 26, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 jndi/jndi-url/src/main/java/org/apache/aries/jndi/services/ServiceHelper.java
@@ -111,7 +111,8 @@ public void add(final BundleContext ctx, ServiceKey k)
BundleContext systemBundle = AccessController.doPrivileged(new PrivilegedAction<BundleContext>() {
public BundleContext run()
{
- return ctx.getBundle(0).getBundleContext();
+ Bundle system = ctx.getBundle(0);
+ return system == null ? null : system.getBundleContext();
}
});
if (systemBundle == null) systemBundle = ctx;

0 comments on commit fa4f318

Please sign in to comment.