!5614 Fix:稳定性问题修复-onNewWant崩溃

Merge pull request !5614 from 张亚菲/zyfFix
This commit is contained in:
openharmony_ci 2023-06-02 09:22:30 +00:00 committed by Gitee
commit 0ec80e0f69
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -829,6 +829,10 @@ void JsAbility::OnNewWant(const Want &want)
napi_value napiWant = OHOS::AppExecFwk::WrapWant(reinterpret_cast<napi_env>(&nativeEngine), want);
NativeValue *jsWant = reinterpret_cast<NativeValue *>(napiWant);
if (jsWant == nullptr) {
HILOG_ERROR("Failed to get want");
return;
}
obj->SetProperty("lastRequestWant", jsWant);