From 42ad987bb7de8a628cad840300f92d44cac67afb Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 13 Jun 2021 14:07:01 +0800 Subject: [PATCH] Validate parameter of SkeletonModificationStack2D::add_modification --- scene/resources/skeleton_modification_stack_2d.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/resources/skeleton_modification_stack_2d.cpp b/scene/resources/skeleton_modification_stack_2d.cpp index d12ec4add30..72c1c330eff 100644 --- a/scene/resources/skeleton_modification_stack_2d.cpp +++ b/scene/resources/skeleton_modification_stack_2d.cpp @@ -160,6 +160,8 @@ Ref SkeletonModificationStack2D::get_modification(int p_ } void SkeletonModificationStack2D::add_modification(Ref p_mod) { + ERR_FAIL_COND(!p_mod.is_valid()); + p_mod->_setup_modification(this); modifications.push_back(p_mod);