From 90451c5c4ab8d11fdccc25c409a33f664a0fd1c3 Mon Sep 17 00:00:00 2001 From: Adam Kapos Date: Tue, 21 Jan 2025 23:23:17 +0200 Subject: [PATCH] Don't construct object graph string while validating without issues --- .../SubContainerCreators/SubContainerCreatorCached.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Providers/SubContainerCreators/SubContainerCreatorCached.cs b/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Providers/SubContainerCreators/SubContainerCreatorCached.cs index b099aae78..c354c35b5 100644 --- a/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Providers/SubContainerCreators/SubContainerCreatorCached.cs +++ b/UnityProject/Assets/Plugins/Zenject/Source/Runtime/Providers/SubContainerCreators/SubContainerCreatorCached.cs @@ -34,8 +34,10 @@ public DiContainer CreateSubContainer(List args, InjectContext co if (_subContainer == null) { #if !ZEN_MULTITHREADING - Assert.That(!_isLookingUp, - "Found unresolvable circular dependency when looking up sub container! Object graph:\n {0}", context.GetObjectGraphString()); + if (this._isLookingUp) + { + Assert.That(false, "Found unresolvable circular dependency when looking up sub container! Object graph:\n {0}", context.GetObjectGraphString()); + } _isLookingUp = true; #endif @@ -48,7 +50,7 @@ public DiContainer CreateSubContainer(List args, InjectContext co Assert.IsNotNull(_subContainer); } - else + else { injectAction = null; }