diff --git a/Robust.Shared/IoC/IoCManager.cs b/Robust.Shared/IoC/IoCManager.cs index 6a3ded8fa..17aa48078 100644 --- a/Robust.Shared/IoC/IoCManager.cs +++ b/Robust.Shared/IoC/IoCManager.cs @@ -203,9 +203,9 @@ namespace Robust.Shared.IoC [MethodImpl(MethodImplOptions.AggressiveOptimization | MethodImplOptions.AggressiveInlining)] public static void Resolve([NotNull] ref T? instance) { - DebugTools.Assert(_container.IsValueCreated, NoContextAssert); - - _container.Value!.Resolve(ref instance); + // Do not call into IDependencyCollection immediately for this, + // avoids thread local lookup if instance is already given. + instance ??= Resolve()!; } ///