diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-06-21 16:22:52 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-06-21 16:22:52 +0300 |
commit | 3bb34fb7eea93ea23c441f46f3965193f03dd5b8 (patch) | |
tree | a621db0e2ead7c3fa86e65d9068aa2e9348d8ffd /source/blender/blenkernel/intern | |
parent | ee78c860b8aa4206ec4d00d733b23c0a0f8d469a (diff) |
NLA: add `BLI_assert_msg()` to check for assumption
`find_active_strip_from_listbase()` expects two lists of strips with an
equal number of items. This is now not only documented, but also checked
for in an assertion.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/nla.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 8f54d71108a..ad1d578d585 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -252,6 +252,9 @@ static NlaStrip *find_active_strip_from_listbase(const NlaStrip *active_strip, const ListBase /* NlaStrip */ *strips_source, const ListBase /* NlaStrip */ *strips_dest) { + BLI_assert_msg(BLI_listbase_count(strips_source) == BLI_listbase_count(strips_dest), + "Expecting the same number of source and destination strips"); + NlaStrip *strip_dest = strips_dest->first; LISTBASE_FOREACH (const NlaStrip *, strip_source, strips_source) { if (strip_dest == NULL) { |