Skip to content

Commit

Permalink
chore: improve the null pointer check: NULL => nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan authored and imstevenpmwork committed Sep 23, 2024
1 parent d09004d commit bcfd7d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/rmw_zenoh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,15 +1568,15 @@ rmw_destroy_subscription(rmw_node_t * node, rmw_subscription_t * subscription)
allocator->deallocate(sub_data->type_support, allocator->state);

z_owned_subscriber_t * sub = std::get_if<z_owned_subscriber_t>(&sub_data->sub);
if (sub != NULL) {
if (sub != nullptr) {
if (z_undeclare_subscriber(z_move(*sub)) != Z_OK) {
RMW_SET_ERROR_MSG("failed to undeclare sub");
ret = RMW_RET_ERROR;
}
} else {
ze_owned_querying_subscriber_t * querying_sub =
std::get_if<ze_owned_querying_subscriber_t>(&sub_data->sub);
if (querying_sub == NULL || ze_undeclare_querying_subscriber(z_move(*querying_sub))) {
if (querying_sub == nullptr || ze_undeclare_querying_subscriber(z_move(*querying_sub))) {
RMW_SET_ERROR_MSG("failed to undeclare sub");
ret = RMW_RET_ERROR;
}
Expand Down

0 comments on commit bcfd7d2

Please sign in to comment.