Commit e1c0c527 authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

Add some tests that roadmap builder has been set before accessing it.

parent bfbd8912
......@@ -120,7 +120,7 @@ namespace hpp {
void Problem::resetGoalConfig ()
{
goalConfigurations_.clear ();
roadmapBuilder_->resetGoalNodes ();
if (roadmapBuilder_) roadmapBuilder_->resetGoalNodes ();
}
// ======================================================================
......@@ -388,7 +388,10 @@ namespace hpp {
} /* if (directPath) */
// solve the problem with the roadmapBuilder
if (!roadmapBuilder_) {
hppDout (error, "No roadmap builder.");
return KD_ERROR;
}
// Set init and goal nodes.
roadmapBuilder_->resetStartNodes ();
roadmapBuilder_->resetGoalNodes ();
......@@ -558,8 +561,8 @@ namespace hpp {
CkwsRoadmapShPtr Problem::roadmap() const
{
return roadmapBuilder_->roadmap ();
if (roadmapBuilder_) return roadmapBuilder_->roadmap ();
return CkwsRoadmapShPtr ();
}
// ======================================================================
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment