aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/GeocoderHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/GeocoderHandler.java')
-rw-r--r--src/org/traccar/GeocoderHandler.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/GeocoderHandler.java b/src/org/traccar/GeocoderHandler.java
index 2742ff1a7..a211d1a23 100644
--- a/src/org/traccar/GeocoderHandler.java
+++ b/src/org/traccar/GeocoderHandler.java
@@ -60,12 +60,11 @@ public class GeocoderHandler implements ChannelUpstreamHandler {
if (processInvalidPositions || position.getValid()) {
if (geocoderReuseDistance != 0) {
Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId());
- if (lastPosition != null && lastPosition.getAddress() != null) {
- if (position.getDouble(Position.KEY_DISTANCE) <= geocoderReuseDistance) {
- position.setAddress(lastPosition.getAddress());
- Channels.fireMessageReceived(ctx, position, event.getRemoteAddress());
- return;
- }
+ if (lastPosition != null && lastPosition.getAddress() != null
+ && position.getDouble(Position.KEY_DISTANCE) <= geocoderReuseDistance) {
+ position.setAddress(lastPosition.getAddress());
+ Channels.fireMessageReceived(ctx, position, event.getRemoteAddress());
+ return;
}
}