--- android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2009/10/28 08:18:07 477 +++ android/TrainInfo/src/dk/thoerup/traininfo/StationList.java 2009/10/28 08:40:32 478 @@ -483,15 +483,17 @@ String addr = lookupAddress(station.getLatitude(), station.getLongitude()); station.setAddress(addr); - if (loc != null) { //only do the distance calc if we have a location - if (method.equals(LookupMethod.ByName) || method.equals(LookupMethod.ByList)) { + + if (method.equals(LookupMethod.ByName) || method.equals(LookupMethod.ByList)) { + if (loc != null) { //only do the distance calc if we have a location dummy.setLatitude(station.getLatitude()); dummy.setLongitude(station.getLongitude()); station.setDistance( (int)loc.distanceTo(dummy) ); + } else { + station.setDistance(0); } - } else { - station.setDistance(0); } + } return null;