Skip to content

Commit

Permalink
Merge pull request #1274 from eloekset/feature/fix1273-integratedmidd…
Browse files Browse the repository at this point in the history
…leware_throws

Check for empty url when hosted in Virtual Directory
  • Loading branch information
tidyui authored Jul 20, 2020
2 parents 7c869c4 + 2bc0d21 commit dc9fec3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/Piranha.AspNetCore/IntegratedMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

//
Expand Down

0 comments on commit dc9fec3

Please sign in to comment.