From bf802d34c6a224131c0fcbac899fdc0af334a631 Mon Sep 17 00:00:00 2001 From: zhouoaoteng Date: Fri, 22 Nov 2024 18:44:05 +0800 Subject: [PATCH] fix hilog Signed-off-by: zhouoaoteng --- frameworks/native/backup_ext/src/ext_extension.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frameworks/native/backup_ext/src/ext_extension.cpp b/frameworks/native/backup_ext/src/ext_extension.cpp index 7f5a72508..77252b298 100644 --- a/frameworks/native/backup_ext/src/ext_extension.cpp +++ b/frameworks/native/backup_ext/src/ext_extension.cpp @@ -396,8 +396,12 @@ ErrCode BackupExtExtension::GetIncrementalFileHandle(const string &fileName) { HITRACE_METER_NAME(HITRACE_TAG_FILEMANAGEMENT, __PRETTY_FUNCTION__); try { - if ((extension_ == nullptr) || (extension_->GetExtensionAction() != BConstants::ExtensionAction::RESTORE)) { - HILOGE("Failed to get incremental file handle, extension or action is invalid, action %{public}d.", + if (extension_ == nullptr) { + HILOGE("Failed to get incremental file handle, extension is invalid"); + throw BError(BError::Codes::EXT_INVAL_ARG, "extension is invalid"); + } + if (extension_->GetExtensionAction() != BConstants::ExtensionAction::RESTORE) { + HILOGE("Failed to get incremental file handle, action is invalid, action %{public}d.", extension_->GetExtensionAction()); throw BError(BError::Codes::EXT_INVAL_ARG, "Action is invalid"); } -- Gitee