Fixes to codegen to avoid nullptr access during disconnects

This commit is contained in:
AMZN-Olex
2021-06-22 10:17:28 -04:00
parent fcbec8c202
commit fd021f065a
@@ -1673,12 +1673,18 @@ namespace {{ Component.attrib['Namespace'] }}
void {{ ComponentBaseName }}::ActivateController(Multiplayer::EntityIsMigrating entityIsMigrating)
{
m_controller.get()->Activate(entityIsMigrating);
if (m_controller)
{
m_controller->Activate(entityIsMigrating);
}
}
void {{ ComponentBaseName }}::DeactivateController(Multiplayer::EntityIsMigrating entityIsMigrating)
{
m_controller.get()->Deactivate(entityIsMigrating);
if (m_controller)
{
m_controller->Deactivate(entityIsMigrating);
}
}
void {{ ComponentBaseName }}::NetworkAttach(Multiplayer::NetBindComponent* netBindComponent, Multiplayer::ReplicationRecord& currentEntityRecord, Multiplayer::ReplicationRecord& predictableEntityRecord)