Skip to content

Commit

Permalink
Merge pull request #552 from Orckestra/dev
Browse files Browse the repository at this point in the history
Fixing an exception during setup if a C1 console for the same website is opened
  • Loading branch information
napernik authored Mar 6, 2018
2 parents ba75fb5 + 9ff44fd commit 0b2a13a
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 0b2a13a

Please sign in to comment.