From 51ce59e24099f2d32b8bfa203289df4ca1e0c1b2 Mon Sep 17 00:00:00 2001 From: Benjamin Jillich <43751992+amzn-jillich@users.noreply.github.com> Date: Mon, 13 Sep 2021 08:25:38 +0200 Subject: [PATCH] EMotion FX: Resetting the anim graph while in the middle of selecting transitions for interruption crashes the Editor (#4026) Signed-off-by: Benjamin Jillich --- .../Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp index ce114a498e..c49f5de085 100644 --- a/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/PropertyWidgets/AnimGraphTransitionHandler.cpp @@ -24,7 +24,6 @@ #include #include - namespace EMotionFX { AZ_CLASS_ALLOCATOR_IMPL(AnimGraphTransitionIdPicker, AZ::SystemAllocator, 0) @@ -126,8 +125,13 @@ namespace EMotionFX } } - void AnimGraphTransitionIdPicker::OnAboutToBeRemoved(const QModelIndex &parent, int first, int last) + void AnimGraphTransitionIdPicker::OnAboutToBeRemoved(const QModelIndex& parent, int first, int last) { + if (!parent.isValid()) + { + return; + } + EMStudio::EMStudioPlugin* plugin = EMStudio::GetPluginManager()->FindActivePlugin(EMStudio::AnimGraphPlugin::CLASS_ID); EMStudio::AnimGraphPlugin* animGraphPlugin = static_cast(plugin); if (animGraphPlugin)