From b02807acd2cd991032221267a699ef74918b9d4f Mon Sep 17 00:00:00 2001 From: tangfan <1824525929@qq.com> Date: Sat, 26 Mar 2022 10:45:45 +0800 Subject: [PATCH] fix bug Signed-off-by: tangfan <1824525929@qq.com> --- .../src/distributed_hardware_manager_factory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_manager_factory.cpp index 7879796a..fe5e48f6 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"); -- Gitee