From c99f7d5b0e0941279b91806f6a6649ba15b27210 Mon Sep 17 00:00:00 2001 From: simon Date: Fri, 18 Sep 2020 13:27:05 +0300 Subject: [PATCH] null ptr crash fixed --- .../main/java/net/osmand/router/RoutePlannerFrontEnd.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java index 663c9ea384..54464afc32 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java @@ -549,8 +549,10 @@ public class RoutePlannerFrontEnd { if (start != null && start.pnt == null) { gctx.routePointsSearched++; RouteSegmentPoint rsp = findRouteSegment(start.loc.getLatitude(), start.loc.getLongitude(), gctx.ctx, null, false); - if (MapUtils.getDistance(rsp.getPreciseLatLon(), start.loc) < distThreshold) { - start.pnt = rsp; + if (rsp != null) { + if (MapUtils.getDistance(rsp.getPreciseLatLon(), start.loc) < distThreshold) { + start.pnt = rsp; + } } } if (start != null && start.pnt != null) {