From 87a0fd85540532a42eb1d1568feb83ed2db99cdd Mon Sep 17 00:00:00 2001 From: pollyzhang Date: Wed, 6 Jul 2022 11:24:49 +0800 Subject: [PATCH] fix(dom): fix animation check crash --- driver/js/core/src/modules/animation_module.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/driver/js/core/src/modules/animation_module.cc b/driver/js/core/src/modules/animation_module.cc index 5bd406d3c..6bb941b31 100644 --- a/driver/js/core/src/modules/animation_module.cc +++ b/driver/js/core/src/modules/animation_module.cc @@ -203,8 +203,11 @@ std::shared_ptr ParseAnimation(const std::shared_ptr& context->ThrowException("animation start_value error"); return nullptr; } - animation_id = footstone::check::checked_numeric_cast(id); - // todo 避免 release checked_numeric_cast crash + flag = footstone::check::numeric_cast(id, animation_id); + if (!flag) { + context->ThrowException("animation id error"); + return nullptr; + } } double to_value;