From 94bbf51bdf1a303dfcb9a04f1629e9cee1567fce Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 18 Oct 2015 11:00:47 +1300 Subject: Handle missing remote address --- src/org/traccar/BasePipelineFactory.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/BasePipelineFactory.java b/src/org/traccar/BasePipelineFactory.java index 6a1d3034f..3b52287b8 100644 --- a/src/org/traccar/BasePipelineFactory.java +++ b/src/org/traccar/BasePipelineFactory.java @@ -69,8 +69,13 @@ public abstract class BasePipelineFactory implements ChannelPipelineFactory { } else { msg.append(" < "); } - - msg.append(((InetSocketAddress) event.getRemoteAddress()).getHostString()).append("]"); + + if (event.getRemoteAddress() != null) { + msg.append(((InetSocketAddress) event.getRemoteAddress()).getHostString()); + } else { + msg.append("null"); + } + msg.append("]"); if (event.getMessage() instanceof ChannelBuffer) { msg.append(" HEX: "); -- cgit v1.2.3