diff --git a/VContainer/Assets/VContainer/Runtime/Unity/VContainerSettings.cs b/VContainer/Assets/VContainer/Runtime/Unity/VContainerSettings.cs index d89307d1..29ee8aa3 100644 --- a/VContainer/Assets/VContainer/Runtime/Unity/VContainerSettings.cs +++ b/VContainer/Assets/VContainer/Runtime/Unity/VContainerSettings.cs @@ -53,7 +53,8 @@ public static void LoadInstanceFromPreloadAssets() var preloadAsset = UnityEditor.PlayerSettings.GetPreloadedAssets().FirstOrDefault(x => x is VContainerSettings); if (preloadAsset is VContainerSettings instance) { - instance.RootLifetimeScope?.DisposeCore(); + if (instance.RootLifetimeScope != null) + instance.RootLifetimeScope.DisposeCore(); instance.OnEnable(); } }