null ptr crash fixed

This commit is contained in:
simon 2020-09-18 13:27:05 +03:00
parent da239a69ff
commit c99f7d5b0e

View file

@ -549,8 +549,10 @@ public class RoutePlannerFrontEnd {
if (start != null && start.pnt == null) { if (start != null && start.pnt == null) {
gctx.routePointsSearched++; gctx.routePointsSearched++;
RouteSegmentPoint rsp = findRouteSegment(start.loc.getLatitude(), start.loc.getLongitude(), gctx.ctx, null, false); RouteSegmentPoint rsp = findRouteSegment(start.loc.getLatitude(), start.loc.getLongitude(), gctx.ctx, null, false);
if (MapUtils.getDistance(rsp.getPreciseLatLon(), start.loc) < distThreshold) { if (rsp != null) {
start.pnt = rsp; if (MapUtils.getDistance(rsp.getPreciseLatLon(), start.loc) < distThreshold) {
start.pnt = rsp;
}
} }
} }
if (start != null && start.pnt != null) { if (start != null && start.pnt != null) {