diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/ServiceHelper.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/ServiceHelper.java index 60a6a029ef..05eaf2e148 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/ServiceHelper.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/ServiceHelper.java @@ -38,11 +38,12 @@ public static T getService(BundleContext context, Class clazz) { } public static T getService(BundleContext context, Class clazz, String filter) { + if (context == null) + return null; Collection> references; try { references = context.getServiceReferences(clazz, filter); } catch (InvalidSyntaxException e) { - // TODO Auto-generated catch block return null; } if (references.isEmpty()) @@ -74,11 +75,12 @@ public static Object getService(BundleContext context, String name) { } public static Object getService(BundleContext context, String name, String filter) { + if (context == null) + return null; ServiceReference[] references; try { references = context.getServiceReferences(name, filter); } catch (InvalidSyntaxException e) { - // TODO Auto-generated catch block return null; } if (references == null || references.length == 0)