EMotion FX: Crash in the actor builder when fbx meta data contains node groups (#4283)

Fixing a crash related to the small array conversion that made multiple assets crash the actor builder.

Signed-off-by: Benjamin Jillich <jillich@amazon.com>
This commit is contained in:
Benjamin Jillich
2021-09-24 09:14:55 +02:00
committed by GitHub
parent 94dfc508ea
commit 4c0796f11e
@@ -6,12 +6,10 @@
*
*/
// include the required headers
#include "NodeGroup.h"
#include "ActorInstance.h"
#include <EMotionFX/Source/Allocators.h>
namespace EMotionFX
{
AZ_CLASS_ALLOCATOR_IMPL(NodeGroup, NodeAllocator, 0)
@@ -104,10 +102,7 @@ namespace EMotionFX
// remove a given node by its node number
void NodeGroup::RemoveNodeByNodeIndex(uint16 nodeIndex)
{
if (const auto found = AZStd::find(begin(m_nodes), end(m_nodes), nodeIndex); found)
{
m_nodes.erase(found);
}
m_nodes.erase(AZStd::remove(m_nodes.begin(), m_nodes.end(), nodeIndex), m_nodes.end());
}