diff --git a/core/Piranha.AspNetCore/IntegratedMiddleware.cs b/core/Piranha.AspNetCore/IntegratedMiddleware.cs index ae18d7498..b0d7449eb 100644 --- a/core/Piranha.AspNetCore/IntegratedMiddleware.cs +++ b/core/Piranha.AspNetCore/IntegratedMiddleware.cs @@ -50,7 +50,7 @@ public override async Task Invoke(HttpContext context, IApi api, IApplicationSer if (!IsHandled(context) && !context.Request.Path.Value.StartsWith("/manager/assets/")) { var url = context.Request.Path.HasValue ? context.Request.Path.Value : ""; - var segments = url.Substring(1).Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + var segments = !string.IsNullOrEmpty(url) ? url.Substring(1).Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries) : new string[] { }; int pos = 0; //