mirror of https://github.com/apache/jclouds.git
Fixed a possible NPE when ServiceFunctionLoader finds no OSGi service for a function.
This commit is contained in:
parent
0666a6fbde
commit
758e01a4d2
|
@ -55,6 +55,7 @@ public class ServiceFunctionLoader implements FunctionLoader {
|
|||
String filter = String.format("(function=*%s.%s*)", function, ShellToken.SH.to(family));
|
||||
try {
|
||||
references = bundleContext.getServiceReferences(FunctionLoader.class.getName(), filter);
|
||||
if (references != null) {
|
||||
for (ServiceReference reference : references) {
|
||||
FunctionLoader loader = (FunctionLoader) bundleContext.getService(reference);
|
||||
String f = loader.loadFunction(function, family);
|
||||
|
@ -62,6 +63,7 @@ public class ServiceFunctionLoader implements FunctionLoader {
|
|||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (InvalidSyntaxException e) {
|
||||
throw new FunctionNotFoundException(function, family, e);
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue