File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
include/libcyphal/presentation Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,13 @@ class ClientBase
9292
9393 ClientBase& operator =(ClientBase&& other) noexcept
9494 {
95- CETL_DEBUG_ASSERT (shared_client_ != nullptr , " Not supposed to move construct to already moved `this`." );
9695 CETL_DEBUG_ASSERT (other.shared_client_ != nullptr ,
9796 " Not supposed to move construct from already moved `other`." );
9897
99- (void ) shared_client_->release ();
98+ if (nullptr != shared_client_)
99+ {
100+ (void ) shared_client_->release ();
101+ }
100102
101103 shared_client_ = std::exchange (other.shared_client_ , nullptr );
102104 priority_ = other.priority_ ;
Original file line number Diff line number Diff line change @@ -78,10 +78,12 @@ class PublisherBase
7878
7979 PublisherBase& operator =(PublisherBase&& other) noexcept
8080 {
81- CETL_DEBUG_ASSERT (impl_ != nullptr , " Not supposed to move to already moved `this`." );
8281 CETL_DEBUG_ASSERT (other.impl_ != nullptr , " Not supposed to move from already moved `other`." );
8382
84- (void ) impl_->release ();
83+ if (nullptr != impl_)
84+ {
85+ (void ) impl_->release ();
86+ }
8587
8688 impl_ = std::exchange (other.impl_ , nullptr );
8789 priority_ = other.priority_ ;
Original file line number Diff line number Diff line change @@ -50,9 +50,12 @@ class SubscriberBase : public SubscriberImpl::CallbackNode
5050
5151 SubscriberBase& operator =(SubscriberBase&& other) noexcept
5252 {
53- CETL_DEBUG_ASSERT (impl_ != nullptr , " Not supposed to move to already moved `this `." );
53+ CETL_DEBUG_ASSERT (other. impl_ != nullptr , " Not supposed to move from already moved `other `." );
5454
55- impl_->releaseCallbackNode (*this );
55+ if (nullptr != impl_)
56+ {
57+ impl_->releaseCallbackNode (*this );
58+ }
5659
5760 impl_ = std::exchange (other.impl_ , nullptr );
5861
You can’t perform that action at this time.
0 commit comments