IssueNo:#I47EPA

Description:if getbundlesize failed return 0
Sig:appexecfwk
Feature or Bugfix:Bugfix
Binary Source:No

Signed-off-by: wangdengjia <wangdengjia@huawei.com>
Change-Id: I0f9263b9a85ce98c36bb3ffc1e61810673d5491e
Signed-off-by: wangdengjia <wangdengjia@huawei.com>
This commit is contained in:
wangdengjia
2021-09-06 15:13:00 +08:00
parent eed7daa1c9
commit 3e1f7f84f4
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ void FreeSystemAvailableCapabilitiesInfo(SystemCapability *sysCap);
* @brief Get bundle size
*
* @param bundleName Indicates the bundle name.
* @return Returns the bundle size if this function is successfully called; returns 0 otherwise.
* @return Returns the bundle size (Byte) if this function is successfully called; returns 0 otherwise.
*
* @since 7
* @version 7
@@ -256,14 +256,14 @@ uint8_t BundleMsFeature::GetInnerBundleSize(const uint8_t funcId, IpcIo *req, Ip
return ERR_APPEXECFWK_OBJECT_NULL;
}
size_t size = 0;
uint32_t bundleSize = 0;
char *bundleName = reinterpret_cast<char *>(IpcIoPopString(req, &size));
if (bundleName == nullptr) {
return ERR_APPEXECFWK_DESERIALIZATION_FAILED;
}
uint32_t bundleSize = GetBundleSize(bundleName);
if (bundleSize == 0) {
return ERR_APPEXECFWK_OBJECT_NULL;
IpcIoPushUint8(reply, static_cast<uint8_t>(OHOS_SUCCESS));
IpcIoPushUint32(reply, bundleSize);
return OHOS_SUCCESS;
}
bundleSize = GetBundleSize(bundleName);
IpcIoPushUint8(reply, static_cast<uint8_t>(OHOS_SUCCESS));
IpcIoPushUint32(reply, bundleSize);
return OHOS_SUCCESS;