Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-03-27 18:08:31 +0000
committerslewis2008-03-27 18:08:31 +0000
commit6ea61780a018aa210a1b92e85cf40bc0cb2bd875 (patch)
treed80db2eab2d090ba7513923db9d4c067e4923235 /providers/bundles/org.eclipse.ecf.provider.jmdns
parent2809c9f87622bc2956bb26483c4cee2c0559f343 (diff)
downloadorg.eclipse.ecf-6ea61780a018aa210a1b92e85cf40bc0cb2bd875.tar.gz
org.eclipse.ecf-6ea61780a018aa210a1b92e85cf40bc0cb2bd875.tar.xz
org.eclipse.ecf-6ea61780a018aa210a1b92e85cf40bc0cb2bd875.zip
Added null checks to some accesses within jmdns for robustnessv20080328-1632
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.jmdns')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java
index f3c42233b..382675880 100644
--- a/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java
+++ b/providers/bundles/org.eclipse.ecf.provider.jmdns/src/org/eclipse/ecf/provider/jmdns/container/JMDNSDiscoveryContainer.java
@@ -196,7 +196,11 @@ public class JMDNSDiscoveryContainer extends AbstractDiscoveryContainerAdapter i
ServiceInfo[] infos = jmdns.list(type.getInternal());
for (int i = 0; i < infos.length; i++) {
try {
- serviceInfos.add(createIServiceInfoFromServiceInfo(infos[i]));
+ if (infos[i] != null) {
+ IServiceInfo si = createIServiceInfoFromServiceInfo(infos[i]);
+ if (si != null)
+ serviceInfos.add(si);
+ }
} catch (Exception e) {
Trace.catching(JMDNSPlugin.PLUGIN_ID, JMDNSDebugOptions.EXCEPTIONS_CATCHING, this.getClass(), "getServices", e); //$NON-NLS-1$
}
@@ -293,6 +297,7 @@ public class JMDNSDiscoveryContainer extends AbstractDiscoveryContainerAdapter i
added = true;
}
}
+ // Fire notification outside synchronized block
if (added) {
try {
fireTypeDiscovered(serviceType);

Back to the top