fixed dereference end iterator assert (#900)

This commit is contained in:
matlabbe
2022-09-19 07:34:48 -07:00
parent 4d6bc78e3d
commit 737675c6f1

View File

@@ -4830,7 +4830,7 @@ std::map<int, Transform> Rtabmap::optimizeGraph(
}
else
{
bool hasLandmarks = edgeConstraints.begin()->first < 0;
bool hasLandmarks = !edgeConstraints.empty() && edgeConstraints.begin()->first < 0;
if(poses.size() != guessPoses.size() || hasLandmarks)
{
UDEBUG("recompute poses using only links (robust to multi-session)");