diff --git a/src/OrchardCore/OrchardCore.Autoroute.Core/Services/AutorouteEntries.cs b/src/OrchardCore/OrchardCore.Autoroute.Core/Services/AutorouteEntries.cs index 1f984e15e05..34224cec280 100644 --- a/src/OrchardCore/OrchardCore.Autoroute.Core/Services/AutorouteEntries.cs +++ b/src/OrchardCore/OrchardCore.Autoroute.Core/Services/AutorouteEntries.cs @@ -34,6 +34,8 @@ public AutorouteEntries(IVolatileDocumentManager autorou public async Task<(bool, AutorouteEntry)> TryGetEntryByPathAsync(string path) { + ArgumentException.ThrowIfNullOrEmpty(path); + await EnsureInitializedAsync(); if (_contentItemIds.TryGetValue(path.TrimEnd('/'), out var entry)) @@ -46,6 +48,8 @@ public AutorouteEntries(IVolatileDocumentManager autorou public async Task<(bool, AutorouteEntry)> TryGetEntryByContentItemIdAsync(string contentItemId) { + ArgumentException.ThrowIfNullOrEmpty(contentItemId); + await EnsureInitializedAsync(); if (_paths.TryGetValue(contentItemId, out var entry))