From 7fee51081ffd9dd6dbf987f6d25850ded9a16a5a Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Thu, 7 Jul 2011 08:54:53 +0000 Subject: [PATCH] Fixing Maney Hill street bug. --- DataStructures/SearchEngine.h | 2 +- Plugins/JSONDescriptor.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataStructures/SearchEngine.h b/DataStructures/SearchEngine.h index 30a7628b8..11843fb0b 100644 --- a/DataStructures/SearchEngine.h +++ b/DataStructures/SearchEngine.h @@ -335,7 +335,7 @@ public: } inline std::string GetEscapedNameForNameID(const NodeID nameID) const { - return ( nameID >= _names->size() ? std::string("") : HTMLEntitize(_names->at(nameID)) ); + return ( (nameID >= _names->size() || nameID == 0) ? std::string("") : HTMLEntitize(_names->at(nameID)) ); } inline short GetTypeOfEdgeForOriginDestinationNodeID(NodeID s, NodeID t) const { diff --git a/Plugins/JSONDescriptor.h b/Plugins/JSONDescriptor.h index 2d5568bcb..ea481d97f 100644 --- a/Plugins/JSONDescriptor.h +++ b/Plugins/JSONDescriptor.h @@ -62,9 +62,9 @@ public: reply.content += ("\"status_message\":"); reply.content += "\"Found route between points\","; unsigned streetID = sEngine->GetNameIDForOriginDestinationNodeID(phantomNodes->startNode1, phantomNodes->startNode2); - startPointName = sEngine->GetEscapedNameForNameID(streetID); + startPointName = (0 == streetID ? "Unnamed origin street" : sEngine->GetEscapedNameForNameID(streetID) ); streetID = sEngine->GetNameIDForOriginDestinationNodeID(phantomNodes->targetNode1, phantomNodes->targetNode2); - endPointName = sEngine->GetEscapedNameForNameID(streetID); + endPointName = (0 == streetID ? "Unnamed destination street" : sEngine->GetEscapedNameForNameID(streetID) ); routeInstructionString += "[\"Head "; _Coordinate tmpCoord;