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 <[email protected]>
  • Loading branch information
Gonzalo de Pedro authored and clalancette committed Dec 20, 2021
1 parent 754090e commit 85ac31c
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 85ac31c

Please sign in to comment.