diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp index 42bf836aa561ceac449d9b2c0fb79517a1b9769b..fc9e052344aecc5a4900191232f493ecec4908da 100644 --- a/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp +++ b/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp @@ -82,6 +82,11 @@ int32_t DistributedHardwareManagerFactory::SendOnLineEvent(const std::string &ne return ERR_DH_FWK_REMOTE_NETWORK_ID_IS_EMPTY; } + if (uuid.empty()) { + DHLOGE("uuid is empty"); + return ERR_DH_FWK_REMOTE_DEVICE_ID_IS_EMPTY; + } + std::lock_guard lock(mutex_); if (distributedHardwareMgrPtr_ == nullptr && !Init()) { DHLOGE("distributedHardwareMgr is null"); @@ -104,11 +109,6 @@ int32_t DistributedHardwareManagerFactory::SendOffLineEvent(const std::string &n return ERR_DH_FWK_REMOTE_NETWORK_ID_IS_EMPTY; } - if (uuid.empty()) { - DHLOGE("uuid is empty"); - return ERR_DH_FWK_REMOTE_DEVICE_ID_IS_EMPTY; - } - std::lock_guard lock(mutex_); if (distributedHardwareMgrPtr_ == nullptr) { DHLOGE("distributedHardwareMgr is null");