Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check nullptr in smoothPlan() #4544

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions nav2_smoother/src/nav2_smoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,12 @@ void SmootherServer::smoothPlan()

auto result = std::make_shared<Action::Result>();
try {
std::string c_name = action_server_->get_current_goal()->smoother_id;
auto goal = action_server_->get_current_goal();
if (!goal) {
return; // if action_server_ is inactivate, goal would be a nullptr
}

std::string c_name = goal->smoother_id;
std::string current_smoother;
if (findSmootherId(c_name, current_smoother)) {
current_smoother_ = current_smoother;
Expand All @@ -274,7 +279,6 @@ void SmootherServer::smoothPlan()
}

// Perform smoothing
auto goal = action_server_->get_current_goal();
result->path = goal->path;

if (!validate(result->path)) {
Expand Down
Loading