Skip to content

Commit

Permalink
Take care of the nullptr case on copy (#3)
Browse files Browse the repository at this point in the history
Signed-off-by: Gonzalo de Pedro <gonzalo@depedro.com.ar>
  • Loading branch information
gonzodepedro authored and Gonzalo de Pedro committed Dec 20, 2021
1 parent ac3baa6 commit a44544f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class ROSCvMatContainer
} else if (std::holds_alternative<std::unique_ptr<sensor_msgs::msg::Image>>(other.storage_)) {
storage_ = std::make_unique<sensor_msgs::msg::Image>(
*std::get<std::unique_ptr<sensor_msgs::msg::Image>>(other.storage_));
} else if (std::holds_alternative<std::nullptr_t>(other.storage_)) {
storage_ = nullptr;
}
}
return *this;
Expand Down

0 comments on commit a44544f

Please sign in to comment.