diff --git a/frameworks/native/backup_ext/src/ext_extension.cpp b/frameworks/native/backup_ext/src/ext_extension.cpp index f92dbab7c8c4060c65aede57daff9306409fdac4..30ac66a3844beeb282e7d141e820332c0e8ecfd3 100644 --- a/frameworks/native/backup_ext/src/ext_extension.cpp +++ b/frameworks/native/backup_ext/src/ext_extension.cpp @@ -1806,6 +1806,11 @@ ErrCode BackupExtExtension::HandleRestore(bool isClearData) .GetCode(); } + auto proxy = ServiceProxy::GetInstance(); + if (proxy == nullptr) { + HILOGE("Failed to obtain the ServiceProxy handle"); + return BError(BError::Codes::EXT_BROKEN_BACKUP_SA).GetCode(); + } // async do restore. if (extension_->WasFromSpecialVersion() && extension_->RestoreDataReady()) { HILOGI("Restore directly when upgrading.");