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.
This commit is contained in:
Sybren A. Stüvel
2022-06-21 15:22:52 +02:00
parent ee78c860b8
commit 3bb34fb7ee

View File

@@ -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) {