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 @Override
public void newRouteIsCalculated(boolean newRoute) { public void newRouteIsCalculated(boolean newRoute) {
RoutingHelper rh = app.getRoutingHelper(); RoutingHelper rh = app.getRoutingHelper();
if(newRoute && rh.isRoutePlanningMode()) { if(newRoute && rh.isRoutePlanningMode() && mapView != null) {
RotatedTileBox rt = mapView.getCurrentRotatedTileBox(); RotatedTileBox rt = mapView.getCurrentRotatedTileBox();
Location lt = rh.getLastProjection(); Location lt = rh.getLastProjection();
if(lt != null) { if(lt != null) {

View file

@ -336,13 +336,15 @@ public class RouteProvider {
List<RouteDirectionInfo> dt = newRes.getDirections(); List<RouteDirectionInfo> dt = newRes.getDirections();
List<RouteDirectionInfo> gpxRouteDirections = rParams.gpxRoute.directions; List<RouteDirectionInfo> gpxRouteDirections = rParams.gpxRoute.directions;
rParams.gpxRoute.points.addAll(0, loct); rParams.gpxRoute.points.addAll(0, loct);
if (gpxRouteDirections != null) {
gpxRouteDirections.addAll(0, dt); gpxRouteDirections.addAll(0, dt);
for(int i = dt.size() ; i < gpxRouteDirections.size(); i++ ) { for (int i = dt.size(); i < gpxRouteDirections.size(); i++) {
gpxRouteDirections.get(i).routePointOffset += loct.size(); gpxRouteDirections.get(i).routePointOffset += loct.size();
} }
} }
} }
} }
}
RouteCalculationResult res; RouteCalculationResult res;
// get the closest point to start and to end // get the closest point to start and to end
GPXRouteParams params = rParams.gpxRoute; GPXRouteParams params = rParams.gpxRoute;