[android] Fixed crash with routing after state restoring.

This commit is contained in:
Dmitry Yunitsky 2015-09-01 17:31:40 +03:00 committed by Alex Zolotarev
parent 27e3be8682
commit 94f74c64fd

View file

@ -348,6 +348,12 @@ public class RoutingLayout extends FrameLayout implements View.OnClickListener
}
Location location = LocationHelper.INSTANCE.getLastLocation();
if (location == null)
{
// TODO remove that hack after proper route reconstruction logic will be finished
setState(State.HIDDEN, false);
return;
}
Framework.nativeBuildRoute(location.getLatitude(), location.getLongitude(), mEndPoint.getLat(), mEndPoint.getLon());
}