Exit gracefully when data is empty

This commit is contained in:
DennisOSRM 2013-01-27 23:08:45 +01:00
parent 03de87c213
commit 0ffa973ec6

View File

@ -108,6 +108,9 @@ public:
int tlon = edge.lon2;
AddEdge( _GridEdge( edge.id, edge.nameID, edge.weight, _Coordinate(slat, slon), _Coordinate(tlat, tlon), edge.belongsToTinyComponent ) );
}
if( 0 == entries.size() ) {
ERR("No viable edges for nearest neighbor index. Aborting");
}
double timestamp = get_timestamp();
//create index file on disk, old one is over written
indexOutFile.open(fileIndexOut, std::ios::out | std::ios::binary | std::ios::trunc);