diff --git a/src/VirtoCommerce.Xapi.Data/Queries/SlugInfoQueryHandler.cs b/src/VirtoCommerce.Xapi.Data/Queries/SlugInfoQueryHandler.cs index 940cc7e..5cb7ab2 100644 --- a/src/VirtoCommerce.Xapi.Data/Queries/SlugInfoQueryHandler.cs +++ b/src/VirtoCommerce.Xapi.Data/Queries/SlugInfoQueryHandler.cs @@ -42,7 +42,7 @@ public async Task Handle(SlugInfoQuery request, CancellationTo var currentCulture = request.CultureName ?? store.DefaultLanguage; var segments = request.Permalink.Split("/", StringSplitOptions.RemoveEmptyEntries); - var lastSegment = segments.Last(); + var lastSegment = segments.LastOrDefault(); var criteria = AbstractTypeFactory.TryCreateInstance(); criteria.StoreId = store.Id;