From a44544ff900d736d569953929bfe9b908a05fa4b Mon Sep 17 00:00:00 2001 From: Gonzo <42421541+gonzodepedro@users.noreply.github.com> Date: Mon, 20 Dec 2021 16:53:27 -0300 Subject: [PATCH] Take care of the nullptr case on copy (#3) Signed-off-by: Gonzalo de Pedro --- .../image_tools/cv_mat_sensor_msgs_image_type_adapter.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/image_tools/include/image_tools/cv_mat_sensor_msgs_image_type_adapter.hpp b/image_tools/include/image_tools/cv_mat_sensor_msgs_image_type_adapter.hpp index 04875b110..ac71289fe 100644 --- a/image_tools/include/image_tools/cv_mat_sensor_msgs_image_type_adapter.hpp +++ b/image_tools/include/image_tools/cv_mat_sensor_msgs_image_type_adapter.hpp @@ -120,6 +120,8 @@ class ROSCvMatContainer } else if (std::holds_alternative>(other.storage_)) { storage_ = std::make_unique( *std::get>(other.storage_)); + } else if (std::holds_alternative(other.storage_)) { + storage_ = nullptr; } } return *this;