Fix frequent NPE

This commit is contained in:
Victor Shcherb 2017-05-29 21:46:10 +02:00
parent 9cee11fefa
commit d6791fc248

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;