1
0
Fork 0

Fixed a bug in Pattern Matching when using a minDepth of 0 and requesting the Edge it caused undefiend behaviour. Now the depth 0 edge will be NULL

This commit is contained in:
Michael Hackstein 2016-06-07 20:03:49 +02:00
parent 69bc031bc7
commit 9a9d59c737
2 changed files with 8 additions and 0 deletions

View File

@ -63,6 +63,10 @@ void ClusterTraversalPath::lastVertexToVelocyPack(Transaction*, VPackBuilder& re
}
void ClusterTraversalPath::lastEdgeToVelocyPack(Transaction*, VPackBuilder& result) {
if (_path.edges.empty()) {
result.add(arangodb::basics::VelocyPackHelper::NullValue());
return;
}
auto cached = _traverser->_edges.find(_path.edges.back());
// All edges are cached!!
TRI_ASSERT(cached != _traverser->_edges.end());

View File

@ -675,6 +675,10 @@ void SingleServerTraversalPath::pathToVelocyPack(Transaction* trx,
}
void SingleServerTraversalPath::lastEdgeToVelocyPack(Transaction* trx, VPackBuilder& result) {
if (_path.edges.empty()) {
result.add(arangodb::basics::VelocyPackHelper::NullValue());
return;
}
auto cached = _traverser->_edges.find(_path.edges.back());
// All edges are cached!!
TRI_ASSERT(cached != _traverser->_edges.end());