Fix frequent NPE

This commit is contained in:
Victor Shcherb 2017-05-29 21:46:10 +02:00
parent b5f3f74726
commit c216ae5fa1

View file

@ -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;