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 a7db5c20e921175ef6862009fe8d28e5409d42c2..e79364a0de1a13fc66bc8d79aa211642d90125d4 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; }