diff --git a/services/abilitymgr/src/ability_manager_service.cpp b/services/abilitymgr/src/ability_manager_service.cpp index 81d8b816ee..0cc76abf64 100644 --- a/services/abilitymgr/src/ability_manager_service.cpp +++ b/services/abilitymgr/src/ability_manager_service.cpp @@ -10701,6 +10701,7 @@ int32_t AbilityManagerService::OnExecuteIntent(AbilityRequest &abilityRequest, { TAG_LOGI(AAFwkTag::ABILITYMGR, "onExecuteIntent"); if (targetRecord == nullptr || targetRecord->GetScheduler() == nullptr) { + TAG_LOGE(AAFwkTag::ABILITYMGR, "null scheduler"); return ERR_INVALID_VALUE; } targetRecord->GetScheduler()->OnExecuteIntent(abilityRequest.want); diff --git a/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp b/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp index 17e708ff9c..654b327c91 100644 --- a/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp +++ b/services/abilitymgr/src/scene_board/ui_ability_lifecycle_manager.cpp @@ -911,11 +911,13 @@ bool UIAbilityLifecycleManager::IsAbilityStarted(AbilityRequest &abilityRequest, return false; } targetRecord = sessionAbilityMap_.at(persistentId); - if (targetRecord) { + if (targetRecord && targetRecord->GetScheduler() != nullptr) { targetRecord->AddCallerRecord(abilityRequest.callerToken, abilityRequest.requestCode, abilityRequest.want); targetRecord->SetLaunchReason(LaunchReason::LAUNCHREASON_CALL); + return true; } - return true; + + return false; } int UIAbilityLifecycleManager::CallAbilityLocked(const AbilityRequest &abilityRequest)