From d6791fc2484a2cf815bd401c5459bcb61e966eb9 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 29 May 2017 21:46:10 +0200 Subject: [PATCH] Fix frequent NPE --- OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index 0c7b344260..91d3a524a1 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -420,7 +420,7 @@ public class VoiceRouter { NextDirectionInfo nextInfo = router.getNextRouteDirectionInfo(new NextDirectionInfo(), true); RouteSegmentResult currentSegment = router.getCurrentSegmentResult(); - if (nextInfo.directionInfo == null) { + if (nextInfo == null || nextInfo.directionInfo == null) { return; } int dist = nextInfo.distanceTo;