Repository: camel Updated Branches: refs/heads/master 14aab3735 -> 349b2fe20
Avoid the potential NPE. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/349b2fe2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/349b2fe2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/349b2fe2 Branch: refs/heads/master Commit: 349b2fe205a814b9f0fe8a82fadb091a67f817fd Parents: 14aab37 Author: Babak Vahdat <bvah...@apache.org> Authored: Tue May 27 14:46:36 2014 +0200 Committer: Babak Vahdat <bvah...@apache.org> Committed: Tue May 27 14:46:36 2014 +0200 ---------------------------------------------------------------------- .../component/netty/SingleUDPNettyServerBootstrapFactory.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/349b2fe2/components/camel-netty/src/main/java/org/apache/camel/component/netty/SingleUDPNettyServerBootstrapFactory.java ---------------------------------------------------------------------- diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/SingleUDPNettyServerBootstrapFactory.java b/components/camel-netty/src/main/java/org/apache/camel/component/netty/SingleUDPNettyServerBootstrapFactory.java index 20faf1a..4807e1e 100644 --- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/SingleUDPNettyServerBootstrapFactory.java +++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/SingleUDPNettyServerBootstrapFactory.java @@ -26,6 +26,7 @@ import java.util.concurrent.ThreadFactory; import org.apache.camel.CamelContext; import org.apache.camel.support.ServiceSupport; +import org.apache.camel.util.ObjectHelper; import org.jboss.netty.bootstrap.ConnectionlessBootstrap; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelPipelineFactory; @@ -161,6 +162,7 @@ public class SingleUDPNettyServerBootstrapFactory extends ServiceSupport impleme datagramChannel = (DatagramChannel)connectionlessBootstrap.bind(hostAddress); String networkInterface = configuration.getNetworkInterface() == null ? LOOPBACK_INTERFACE : configuration.getNetworkInterface(); multicastNetworkInterface = NetworkInterface.getByName(networkInterface); + ObjectHelper.notNull(multicastNetworkInterface, "No network interface found for '" + networkInterface + "'."); LOG.info("ConnectionlessBootstrap joining {}:{} using network interface: {}", new Object[]{configuration.getHost(), configuration.getPort(), multicastNetworkInterface.getName()}); datagramChannel.joinGroup(hostAddress, multicastNetworkInterface); allChannels.add(datagramChannel);