Skip to content

Commit

Permalink
Fixing an exception during setup if a C1 console for the same website…
Browse files Browse the repository at this point in the history
… is opened
  • Loading branch information
napernik committed Mar 6, 2018
1 parent 264704e commit 9ff44fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Composite/Core/ServiceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ internal static bool HasService(Type serviceType)
{
Verify.ArgumentNotNull(serviceType, nameof(serviceType));

if (!SystemSetupFacade.IsSystemFirstTimeInitialized || SystemSetupFacade.SetupIsRunning)
if (ServiceLocatorNotInitialized)
{
return false;
}
Expand Down Expand Up @@ -221,7 +221,7 @@ internal static void DisposeRequestServicesScope(HttpContext context)

internal static IDisposable EnsureThreadDataServiceScope()
{
if (RequestScopedServiceProvider != null) return EmptyDisposable.Instance;
if (RequestScopedServiceProvider != null || ServiceLocatorNotInitialized) return EmptyDisposable.Instance;

var current = ThreadDataManager.GetCurrentNotNull();

Expand Down Expand Up @@ -277,5 +277,7 @@ public void Dispose()
}
}

private static bool ServiceLocatorNotInitialized =>
!SystemSetupFacade.IsSystemFirstTimeInitialized || SystemSetupFacade.SetupIsRunning;
}
}

0 comments on commit 9ff44fd

Please sign in to comment.