File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,12 @@ void SmootherServer::smoothPlan()
265265
266266 auto result = std::make_shared<Action::Result>();
267267 try {
268- std::string c_name = action_server_->get_current_goal ()->smoother_id ;
268+ auto goal = action_server_->get_current_goal ();
269+ if (!goal) {
270+ return ; // if action_server_ is inactivate, goal would be a nullptr
271+ }
272+
273+ std::string c_name = goal->smoother_id ;
269274 std::string current_smoother;
270275 if (findSmootherId (c_name, current_smoother)) {
271276 current_smoother_ = current_smoother;
@@ -274,7 +279,6 @@ void SmootherServer::smoothPlan()
274279 }
275280
276281 // Perform smoothing
277- auto goal = action_server_->get_current_goal ();
278282 result->path = goal->path ;
279283
280284 if (!validate (result->path )) {
You can’t perform that action at this time.
0 commit comments