From e7b31a22bef1dd36ae69baf7d76dd146cecfa4ae Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle Date: Thu, 24 Feb 2022 15:44:49 +0100 Subject: [PATCH] Fix scope --- src/Umbraco.Infrastructure/Scoping/Scope.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Infrastructure/Scoping/Scope.cs b/src/Umbraco.Infrastructure/Scoping/Scope.cs index 6429d9109a..aa3c4bb4c9 100644 --- a/src/Umbraco.Infrastructure/Scoping/Scope.cs +++ b/src/Umbraco.Infrastructure/Scoping/Scope.cs @@ -594,10 +594,6 @@ namespace Umbraco.Cms.Core.Scoping } else { - if (_database is null) - { - return; - } lock (_lockQueueLocker) { if (_queuedLocks?.Count > 0) @@ -626,12 +622,12 @@ namespace Umbraco.Cms.Core.Scoping switch (currentType) { case LockType.ReadLock: - EagerReadLockInner(_database, currentInstanceId, + EagerReadLockInner(_database!, currentInstanceId, currentTimeout == TimeSpan.Zero ? null : currentTimeout, collectedIds.ToArray()); break; case LockType.WriteLock: - EagerWriteLockInner(_database, currentInstanceId, + EagerWriteLockInner(_database!, currentInstanceId, currentTimeout == TimeSpan.Zero ? null : currentTimeout, collectedIds.ToArray()); break; @@ -652,11 +648,11 @@ namespace Umbraco.Cms.Core.Scoping switch (currentType) { case LockType.ReadLock: - EagerReadLockInner(_database, currentInstanceId, + EagerReadLockInner(_database!, currentInstanceId, currentTimeout == TimeSpan.Zero ? null : currentTimeout, collectedIds.ToArray()); break; case LockType.WriteLock: - EagerWriteLockInner(_database, currentInstanceId, + EagerWriteLockInner(_database!, currentInstanceId, currentTimeout == TimeSpan.Zero ? null : currentTimeout, collectedIds.ToArray()); break; }