From cb13ea6ee880b2a119ecdbac40afd99596b26023 Mon Sep 17 00:00:00 2001 From: HuangXW Date: Thu, 20 Oct 2022 19:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=90=8C=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E4=B8=8B=E8=B0=83=E7=94=A8ExecuteBatch,=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=E6=97=A0=E6=95=88=E5=8F=82=E6=95=B0=E5=AF=BC=E8=87=B4crash?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic03c05bd2d6885afefb5f1b0526a85a99a60371a Signed-off-by: HuangXW --- frameworks/native/ability/native/data_ability_impl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/native/ability/native/data_ability_impl.cpp b/frameworks/native/ability/native/data_ability_impl.cpp index 9346a81343..57772a5c5e 100644 --- a/frameworks/native/ability/native/data_ability_impl.cpp +++ b/frameworks/native/ability/native/data_ability_impl.cpp @@ -409,6 +409,10 @@ bool DataAbilityImpl::CheckExecuteBatchPermission( size_t size = operations.size(); for (size_t i = 0; i < size; i++) { std::shared_ptr operation = operations[i]; + if (operation == nullptr) { + HILOG_ERROR("operation[i] is nullptr, index: %{public}d", static_cast(i)); + return false; + } if (operation->IsInsertOperation() || operation->IsUpdateOperation() || operation->IsDeleteOperation()) { needCheckWritePermission = true; } else if (operation->IsAssertOperation()) {