aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-18 11:00:47 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-18 11:00:47 +1300
commit94bbf51bdf1a303dfcb9a04f1629e9cee1567fce (patch)
tree4b4415c4dbf7b1bf42dcc07cd0231788d0aff466
parentc6c26aa02e2e75e4dbd8774e7c201b2e826b31c6 (diff)
downloadtrackermap-server-94bbf51bdf1a303dfcb9a04f1629e9cee1567fce.tar.gz
trackermap-server-94bbf51bdf1a303dfcb9a04f1629e9cee1567fce.tar.bz2
trackermap-server-94bbf51bdf1a303dfcb9a04f1629e9cee1567fce.zip
Handle missing remote address
-rw-r--r--src/org/traccar/BasePipelineFactory.java9
1 files changed, 7 insertions, 2 deletions
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: ");