From 0eece9f2e5ce660a63e713dffb88ce2764fc8421 Mon Sep 17 00:00:00 2001 From: huyx Date: Thu, 10 Jul 2025 11:44:50 +0800 Subject: [PATCH] =?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: huyx --- display/buffer/v1_0/hdi_impl/display_buffer_hdi_impl.h | 3 +++ 1 file changed, 3 insertions(+) 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..e79364a0 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,6 +90,7 @@ public: { if (recipient_ != nullptr) { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); + CHECK_NULLPOINTER_RETURN_VALUE(remoteObj, HDF_FAILURE); remoteObj->RemoveDeathRecipient(recipient_); recipient_ = nullptr; } @@ -98,6 +99,7 @@ public: bool AddDeathRecipient(const sptr& recipient) override { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); + CHECK_NULLPOINTER_RETURN_VALUE(remoteObj, HDF_FAILURE); if (recipient_ != nullptr) { HDF_LOGE("%{public}s: the existing recipient is removed, and add the new. %{public}d", __func__, __LINE__); @@ -117,6 +119,7 @@ public: { if (recipient_ != nullptr) { sptr remoteObj = OHOS::HDI::hdi_objcast(allocator_); + CHECK_NULLPOINTER_RETURN_VALUE(remoteObj, HDF_FAILURE); remoteObj->RemoveDeathRecipient(recipient_); recipient_ = nullptr; } -- Gitee