commit | 43ffa2914416622df7a93a719887eadbdd0d7823 | [log] [tgz] |
---|---|---|
author | Felix Meschberger <fmeschbe@apache.org> | Thu Apr 08 07:30:30 2010 +0000 |
committer | Felix Meschberger <fmeschbe@apache.org> | Thu Apr 08 07:30:30 2010 +0000 |
tree | 9217eb02a9c60d56106eab169d4a0f5a9fde5680 | |
parent | 6a420d367937ae02c730f282c26054277e5a7149 [diff] |
FELIX-2260 Prevent NullPointerException if no services are available git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@931811 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java index ca3945c..5e101c4 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java
@@ -274,13 +274,19 @@ { try { - return getBundleContext().getAllServiceReferences( null, null ); + final ServiceReference[] refs = getBundleContext().getAllServiceReferences( null, null ); + if ( refs != null ) + { + return refs; + } } catch ( InvalidSyntaxException e ) { log( "Unable to access service reference list.", e ); - return NO_REFS; } + + // no services or invalid filter syntax (unlikely) + return NO_REFS; }