diff options
author | Kodi <christopher.willis82@gmail.com> | 2021-11-16 00:43:51 -0500 |
---|---|---|
committer | Kodi <christopher.willis82@gmail.com> | 2021-11-16 19:09:01 -0500 |
commit | bdcd98c6ce568a63589f350133113a2d06c17c46 (patch) | |
tree | 548f3215fab5dce876219850b718bfb5e29245da | |
parent | 53ae45f657b63a7e9c122f8db27f5f9b5f8dda98 (diff) |
add input validation for set_modification_count
update error macros for set_modification_count
-rw-r--r-- | scene/resources/skeleton_modification_stack_2d.cpp | 1 | ||||
-rw-r--r-- | scene/resources/skeleton_modification_stack_3d.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/skeleton_modification_stack_2d.cpp b/scene/resources/skeleton_modification_stack_2d.cpp index db9fe62b4d..25c3e9d2ef 100644 --- a/scene/resources/skeleton_modification_stack_2d.cpp +++ b/scene/resources/skeleton_modification_stack_2d.cpp @@ -195,6 +195,7 @@ void SkeletonModificationStack2D::set_modification(int p_mod_idx, Ref<SkeletonMo } void SkeletonModificationStack2D::set_modification_count(int p_count) { + ERR_FAIL_COND_MSG(p_count < 0, "Modification count cannot be less than zero."); modifications.resize(p_count); notify_property_list_changed(); diff --git a/scene/resources/skeleton_modification_stack_3d.cpp b/scene/resources/skeleton_modification_stack_3d.cpp index c03210cf48..301811f0b6 100644 --- a/scene/resources/skeleton_modification_stack_3d.cpp +++ b/scene/resources/skeleton_modification_stack_3d.cpp @@ -149,6 +149,7 @@ void SkeletonModificationStack3D::set_modification(int p_mod_idx, Ref<SkeletonMo } void SkeletonModificationStack3D::set_modification_count(int p_count) { + ERR_FAIL_COND_MSG(p_count < 0, "Modification count cannot be less than zero."); modifications.resize(p_count); notify_property_list_changed(); } |