diff options
author | Viktor Govako <viktor.govako@gmail.com> | 2016-04-01 20:27:46 +0300 |
---|---|---|
committer | Viktor Govako <viktor.govako@gmail.com> | 2016-04-01 20:27:46 +0300 |
commit | 77309660bdbaed9a087993277c7ef0fe80c266f3 (patch) | |
tree | 223afc6ebc9e3f9d5b8575b8a87c6ac26e47cb54 | |
parent | c7f8c2ea2fbfde577e85c02b0d4e3bb613982f5d (diff) | |
parent | e01407f88c8ba315492e876adaa3f2895617fbbc (diff) |
Merge pull request #2695 from gardster/routing_crash_fix_release
Routing unpacking error workaround.
-rw-r--r-- | routing/turns_generator.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/routing/turns_generator.cpp b/routing/turns_generator.cpp index 6d743b4ffd..f6ae39f2dd 100644 --- a/routing/turns_generator.cpp +++ b/routing/turns_generator.cpp @@ -11,6 +11,7 @@ #include "base/macros.hpp" +#include "3party/Alohalytics/src/alohalytics.h" #include "3party/osrm/osrm-backend/data_structures/internal_route_result.hpp" #include "std/cmath.hpp" @@ -476,6 +477,17 @@ LoadedPathSegment::LoadedPathSegment(RoutingMapping & mapping, Index const & ind { buffer_vector<TSeg, 8> buffer; mapping.m_segMapping.ForEachFtSeg(osrmPathSegment.node, MakeBackInsertFunctor(buffer)); + if (buffer.empty()) + { + LOG(LWARNING, ("Can't unpack geometry for map:", mapping.GetCountryName(), " node: ", + osrmPathSegment.node)); + alohalytics::Stats::Instance().LogEvent( + "RouteTracking_UnpackingError", + {{"node", strings::to_string(osrmPathSegment.node)}, + {"map", mapping.GetCountryName()}, + {"version", strings::to_string(mapping.GetMwmId().GetInfo()->GetVersion())}}); + return; + } LoadPathGeometry(buffer, 0, buffer.size(), index, mapping, FeatureGraphNode(), FeatureGraphNode(), false /* isStartNode */, false /*isEndNode*/); } @@ -924,7 +936,8 @@ size_t CheckUTurnOnRoute(vector<LoadedPathSegment> const & segments, size_t curr ASSERT_GREATER(currentSegment, 0, ()); ASSERT_GREATER(segments.size(), currentSegment, ()); auto const & masterSegment = segments[currentSegment - 1]; - ASSERT_GREATER(masterSegment.m_path.size(), 1, ()); + if (masterSegment.m_path.size() < 2) + return 0; // Roundabout is not the UTurn. if (masterSegment.m_onRoundabout) return 0; |