!8868 JSonField修复

Merge pull request !8868 from mashaohua7/master
This commit is contained in:
openharmony_ci 2024-06-05 03:48:52 +00:00 committed by Gitee
commit 9434023218
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -409,8 +409,8 @@ AutoStartupInfo AbilityAutoStartupDataManager::ConvertAutoStartupInfoFromKeyAndV
info.abilityName = jsonObject.at(JSON_KEY_ABILITY_NAME).get<std::string>();
}
if (jsonObject.contains(JSON_KEY_APP_CLONE_INDEX) && jsonObject[JSON_KEY_APP_CLONE_INDEX].is_string()) {
info.appCloneIndex = jsonObject.at(JSON_KEY_APP_CLONE_INDEX).get<std::int32_t>();
if (jsonObject.contains(JSON_KEY_APP_CLONE_INDEX) && jsonObject[JSON_KEY_APP_CLONE_INDEX].is_number()) {
info.appCloneIndex = jsonObject.at(JSON_KEY_APP_CLONE_INDEX).get<int32_t>();
}
if (jsonObject.contains(JSON_KEY_ACCESS_TOKENID) && jsonObject[JSON_KEY_ACCESS_TOKENID].is_string()) {
@ -462,8 +462,8 @@ bool AbilityAutoStartupDataManager::IsEqual(const DistributedKv::Key &key, const
}
}
if (jsonObject.contains(JSON_KEY_APP_CLONE_INDEX) && jsonObject[JSON_KEY_APP_CLONE_INDEX].is_string()) {
if (info.appCloneIndex != jsonObject.at(JSON_KEY_APP_CLONE_INDEX).get<std::int32_t>()) {
if (jsonObject.contains(JSON_KEY_APP_CLONE_INDEX) && jsonObject[JSON_KEY_APP_CLONE_INDEX].is_number()) {
if (info.appCloneIndex != jsonObject.at(JSON_KEY_APP_CLONE_INDEX).get<int32_t>()) {
return false;
}
}