diff --git a/Runtime/EntityComponent.cs b/Runtime/EntityComponent.cs index 613d71b..a0091e4 100644 --- a/Runtime/EntityComponent.cs +++ b/Runtime/EntityComponent.cs @@ -114,6 +114,8 @@ void OnDisable () { /// Event invoked by the Unity Engine when the component is destroyed. /// void OnDestroy () { + if (!isInitialized) + return; var system = GetSystem (); // Remove the entity from the system. system.RemoveEntry ((EntityComponentType)this);