Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): fix GetInternalField animation 0x241d000023a1 crash #3585

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions driver/js/src/modules/animation_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ std::shared_ptr<ParseAnimationResult> ParseAnimation(const std::shared_ptr<Ctx>&
const std::shared_ptr<CtxValue> arguments[],
std::shared_ptr<CtxValue>& exception) {
if (argument_count != kAnimationUpdateArgc) {
exception = context->CreateException("animation argument count error");
return nullptr;
}

Expand Down Expand Up @@ -306,11 +307,13 @@ RegisterAnimation(const std::weak_ptr<Scope>& weak_scope) {
auto weak_dom_manager = scope->GetDomManager();
auto dom_manager = weak_dom_manager.lock();
if (!dom_manager) {
exception = scope->GetContext()->CreateException("dom_manager null error");
return nullptr;
}
auto weak_root_node = scope->GetRootNode();
auto root_node = weak_root_node.lock();
if (!root_node) {
exception = scope->GetContext()->CreateException("root_node null error");
return nullptr;
}
auto result = ParseAnimation(scope->GetContext(), argument_count, arguments, exception);
Expand Down Expand Up @@ -619,15 +622,18 @@ RegisterAnimationSet(const std::weak_ptr<Scope>& weak_scope) {
auto weak_dom_manager = scope->GetDomManager();
auto dom_manager = weak_dom_manager.lock();
if (!dom_manager) {
exception = scope->GetContext()->CreateException("dom_manager null error");
return nullptr;
}
auto weak_root_node = scope->GetRootNode();
auto root_node = weak_root_node.lock();
if (!root_node) {
exception = scope->GetContext()->CreateException("root_node null error");
return nullptr;
}
auto animation_manager = root_node->GetAnimationManager();
if (!animation_manager) {
exception = scope->GetContext()->CreateException("animation_manager null error");
return nullptr;
}
auto set = ParseAnimationSet(scope->GetContext(), argument_count, arguments, exception);
Expand Down
Loading