Fix exception traces

This commit is contained in:
vshcherb 2014-03-29 21:21:04 +01:00
parent c515f2cbc2
commit a5747c8e91
2 changed files with 6 additions and 4 deletions

View file

@ -282,7 +282,7 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
@Override
public void newRouteIsCalculated(boolean newRoute) {
RoutingHelper rh = app.getRoutingHelper();
if(newRoute && rh.isRoutePlanningMode()) {
if(newRoute && rh.isRoutePlanningMode() && mapView != null) {
RotatedTileBox rt = mapView.getCurrentRotatedTileBox();
Location lt = rh.getLastProjection();
if(lt != null) {

View file

@ -336,9 +336,11 @@ public class RouteProvider {
List<RouteDirectionInfo> dt = newRes.getDirections();
List<RouteDirectionInfo> gpxRouteDirections = rParams.gpxRoute.directions;
rParams.gpxRoute.points.addAll(0, loct);
gpxRouteDirections.addAll(0, dt);
for(int i = dt.size() ; i < gpxRouteDirections.size(); i++ ) {
gpxRouteDirections.get(i).routePointOffset += loct.size();
if (gpxRouteDirections != null) {
gpxRouteDirections.addAll(0, dt);
for (int i = dt.size(); i < gpxRouteDirections.size(); i++) {
gpxRouteDirections.get(i).routePointOffset += loct.size();
}
}
}
}