From 462b7e25432c4faee03df2743213dd453e9783ec Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Tue, 3 Mar 2020 11:21:01 +0300 Subject: [PATCH] [routing] Crashfix in case traffic jam has been downloaded while the first route building. --- routing/routing_session.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routing/routing_session.cpp b/routing/routing_session.cpp index 2a70797f0f..a18642ff8b 100644 --- a/routing/routing_session.cpp +++ b/routing/routing_session.cpp @@ -281,7 +281,11 @@ SessionState RoutingSession::OnLocationPositionChanged(GpsInfo const & info) } CHECK(m_route, (m_state)); - CHECK(m_route->IsValid(), (m_state)); + // Note. The route may not be valid here. It happens in case when while the first route + // build is cancelled because of traffic jam were downloaded. After that route rebuilding + // happens. While the rebuilding may be called OnLocationPositionChanged(...) + if (!m_route->IsValid()) + return m_state; m_turnNotificationsMgr.SetSpeedMetersPerSecond(info.m_speedMpS);