summaryrefslogtreecommitdiff
path: root/src/components/connection_handler/src/connection_handler_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/connection_handler/src/connection_handler_impl.cc')
-rw-r--r--src/components/connection_handler/src/connection_handler_impl.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/components/connection_handler/src/connection_handler_impl.cc b/src/components/connection_handler/src/connection_handler_impl.cc
index 109e41b836..5b26304302 100644
--- a/src/components/connection_handler/src/connection_handler_impl.cc
+++ b/src/components/connection_handler/src/connection_handler_impl.cc
@@ -753,12 +753,11 @@ struct CompareMAC {
bool ConnectionHandlerImpl::GetDeviceID(const std::string& mac_address,
DeviceHandle* device_handle) {
+ DCHECK_OR_RETURN(device_handle, false);
DeviceMap::const_iterator it = std::find_if(
device_list_.begin(), device_list_.end(), CompareMAC(mac_address));
if (it != device_list_.end()) {
- if (device_handle) {
- *device_handle = it->first;
- }
+ *device_handle = it->first;
return true;
}
return false;
@@ -775,7 +774,7 @@ int32_t ConnectionHandlerImpl::GetDataOnDeviceID(
int32_t result = -1;
DeviceMap::const_iterator it = device_list_.find(device_handle);
if (device_list_.end() == it) {
- LOG4CXX_ERROR(logger_, "Device not found!");
+ LOG4CXX_ERROR(logger_, "Device not found for handle " << device_handle);
return result;
}