Fix NullPointerException when obtaining protocol provider factory.

cusax-fix
Yana Stamcheva 16 years ago
parent 1c14468408
commit 26a2216015

@ -243,10 +243,13 @@ public static ProtocolProviderFactory getProtocolProviderFactory(
try
{
ServiceReference[] serRefs
= GuiActivator.bundleContext.getServiceReferences(
= bundleContext.getServiceReferences(
ProtocolProviderFactory.class.getName(), osgiFilter);
protocolProviderFactory = (ProtocolProviderFactory) GuiActivator
.bundleContext.getService(serRefs[0]);
if (serRefs != null && serRefs.length > 0)
protocolProviderFactory
= (ProtocolProviderFactory) bundleContext
.getService(serRefs[0]);
}
catch (InvalidSyntaxException ex)
{

Loading…
Cancel
Save