From cc5d883324802135c28f2af5a126cd6002ee851e Mon Sep 17 00:00:00 2001 From: etkmao Date: Tue, 31 Oct 2023 23:17:09 +0800 Subject: [PATCH] fix(core): fix GetInternalField animation 0x241d000023a1 crash --- driver/js/src/modules/animation_module.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/driver/js/src/modules/animation_module.cc b/driver/js/src/modules/animation_module.cc index 7146ffa178c..9c26a60f154 100644 --- a/driver/js/src/modules/animation_module.cc +++ b/driver/js/src/modules/animation_module.cc @@ -166,6 +166,7 @@ std::shared_ptr ParseAnimation(const std::shared_ptr& const std::shared_ptr arguments[], std::shared_ptr& exception) { if (argument_count != kAnimationUpdateArgc) { + exception = context->CreateException("animation argument count error"); return nullptr; } @@ -306,11 +307,13 @@ RegisterAnimation(const std::weak_ptr& 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); @@ -619,15 +622,18 @@ RegisterAnimationSet(const std::weak_ptr& 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);