Closed roncapat closed 2 months ago
Good find. If you'd like to open a PR to add a nullptr
check and throw an exception, we'd be happy to review it. Please target the rolling
branch first, then we can backport to iron
and humble
as necessary.
@clalancette will do. Question for you: what could be a proper way to handle nullptr being returned? Throw an error?
@clalancette will do. Question for you: what could be a proper way to handle nullptr being returned? Throw an error?
Yeah, I think throwing an exception here is probably the most consistent thing to do (we do that elsewhere in this file).
C++ is not officially supported yet.
This means this could not be a bug, as std::allocator<void>::allocate()
already throws std::bad_alloc
.
Branch:
iron
GCC version: 11.4 OS: Ubuntu 22.04Steps to reproduce:
build any
rclcpp
-dependent package using TypeAdapters with-fanalyzer
flag.See output below:
From what I can understand, this is due to: https://github.com/ros2/rclcpp/blob/04ea0bb00293387791522590b7347a2282cda290/rclcpp/include/rclcpp/any_subscription_callback.hpp#L452 not being checked against
nullptr
.