return empty EdgePath() on error

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37227 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2011-01-16 09:53:56 +00:00
parent a26dd20159
commit d9a4a443e7

View File

@ -167,12 +167,11 @@ Graph::EdgePath const Graph::getPath(int from, int to)
{
Mutex::Locker lock(&mutex_);
static const EdgePath path;
if (from == to)
return path;
return EdgePath();
if (to < 0 || !bfs_init(from))
return path;
return EdgePath();
clearPaths();
while (!Q_.empty()) {
@ -201,7 +200,7 @@ Graph::EdgePath const Graph::getPath(int from, int to)
}
}
// failure
return path;
return EdgePath();
}