diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h index e361e71415..781dcb9ed8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.h @@ -208,7 +208,13 @@ namespace ScriptCanvas static const t_Value* Help(Datum& datum) { static_assert(!AZStd::is_pointer::value, "no pointer types in the Datum::GetAsHelper"); - if (datum.m_type.GetType() == Data::eType::BehaviorContextObject) + + if (datum.m_storage.empty()) + { + // rare, but can be caused by removals or problems with reflection to BehaviorContext, so must be checked + return nullptr; + } + else if (datum.m_type.GetType() == Data::eType::BehaviorContextObject) { return (*AZStd::any_cast(&datum.m_storage))->CastConst(); }