diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp index 7879796a611c8a91c88e80dc18dfcf9c4d968c2b..fe5e48f60041f8e28f0146a6c700597d7f5c367c 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");