diff options
Diffstat (limited to 'src/components/transport_manager/src/tcp/tcp_device.cc')
-rw-r--r-- | src/components/transport_manager/src/tcp/tcp_device.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/components/transport_manager/src/tcp/tcp_device.cc b/src/components/transport_manager/src/tcp/tcp_device.cc index 16abdfc22d..d9bc8aec78 100644 --- a/src/components/transport_manager/src/tcp/tcp_device.cc +++ b/src/components/transport_manager/src/tcp/tcp_device.cc @@ -66,9 +66,9 @@ TcpDevice::TcpDevice(const in_addr_t& in_addr, bool TcpDevice::IsSameAs(const Device* other) const { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "Device: " << other); - const TcpDevice* other_tcp_device = static_cast<const TcpDevice*>(other); + const TcpDevice* other_tcp_device = dynamic_cast<const TcpDevice*>(other); - if (other_tcp_device->in_addr_ == in_addr_) { + if (other_tcp_device && other_tcp_device->in_addr_ == in_addr_) { LOG4CXX_TRACE( logger_, "exit with TRUE. Condition: other_tcp_device->in_addr_ == in_addr_"); |