diff --git a/Code/Editor/CryEditDoc.cpp b/Code/Editor/CryEditDoc.cpp index 76704a3f07..a61429fc87 100644 --- a/Code/Editor/CryEditDoc.cpp +++ b/Code/Editor/CryEditDoc.cpp @@ -132,14 +132,19 @@ CCryEditDoc::CCryEditDoc() RegisterConsoleVariables(); MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_FILE_SAVE_AS, this, &CCryEditDoc::OnFileSaveAs); - m_prefabSystemComponentInterface = AZ::Interface::Get(); - AZ_Assert(m_prefabSystemComponentInterface, "PrefabSystemComponentInterface is not found."); - m_prefabEditorEntityOwnershipInterface = AZ::Interface::Get(); - AZ_Assert(m_prefabEditorEntityOwnershipInterface, "PrefabEditorEntityOwnershipInterface is not found."); - m_prefabLoaderInterface = AZ::Interface::Get(); - AZ_Assert(m_prefabLoaderInterface, "PrefabLoaderInterface is not found."); - m_prefabIntegrationInterface = AZ::Interface::Get(); - AZ_Assert(m_prefabIntegrationInterface, "PrefabIntegrationInterface is not found."); + bool isPrefabSystemEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult(isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + if (isPrefabSystemEnabled) + { + m_prefabSystemComponentInterface = AZ::Interface::Get(); + AZ_Assert(m_prefabSystemComponentInterface, "PrefabSystemComponentInterface is not found."); + m_prefabEditorEntityOwnershipInterface = AZ::Interface::Get(); + AZ_Assert(m_prefabEditorEntityOwnershipInterface, "PrefabEditorEntityOwnershipInterface is not found."); + m_prefabLoaderInterface = AZ::Interface::Get(); + AZ_Assert(m_prefabLoaderInterface, "PrefabLoaderInterface is not found."); + m_prefabIntegrationInterface = AZ::Interface::Get(); + AZ_Assert(m_prefabIntegrationInterface, "PrefabIntegrationInterface is not found."); + } } CCryEditDoc::~CCryEditDoc()