From fc159cd9dd7e8fd0d713d5bc2ee4fdd62c245ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=E4=B8=B6H?= Date: Thu, 10 Jul 2025 04:09:25 +0000 Subject: [PATCH 1/2] =?UTF-8?q?CODECHECK=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Richard丶H --- display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h index a7db5c20..e5cffa95 100644 --- a/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h @@ -90,14 +90,17 @@ public: { if (recipient_ != nullptr) { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); - remoteObj->RemoveDeathRecipient(recipient_); - recipient_ = nullptr; + if (remoteObj !=nullptr) { + remoteObj->RemoveDeathRecipient(recipient_); + recipient_ = nullptr; + } } } bool AddDeathRecipient(const sptr& recipient) override { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); + CHECK_NULLPOINTER_RETURN_VALUE(remoteObj, false); if (recipient_ != nullptr) { HDF_LOGE("%{public}s: the existing recipient is removed, and add the new. %{public}d", __func__, __LINE__); @@ -117,6 +120,7 @@ public: { if (recipient_ != nullptr) { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); + CHECK_NULLPOINTER_RETURN_VALUE(remoteObj, false); remoteObj->RemoveDeathRecipient(recipient_); recipient_ = nullptr; } -- Gitee From 90bfd89c691c1eb67c7a441577ed1af4c5854568 Mon Sep 17 00:00:00 2001 From: huyx Date: Tue, 15 Jul 2025 21:01:10 +0800 Subject: [PATCH 2/2] codecheck Signed-off-by: huyx --- display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h b/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h index e5cffa95..47e5710e 100644 --- a/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h +++ b/display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h @@ -90,7 +90,7 @@ public: { if (recipient_ != nullptr) { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); - if (remoteObj !=nullptr) { + if (remoteObj != nullptr) { remoteObj->RemoveDeathRecipient(recipient_); recipient_ = nullptr; } -- Gitee