Skip to content

Commit

Permalink
Fix issue: [DEV] Images missing from Dev environment (#5280)
Browse files Browse the repository at this point in the history
Fix null ref exception.
  • Loading branch information
cristinamanum authored Jan 17, 2018
1 parent 3527bef commit caa82d0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/NuGetGallery/Telemetry/ClientTelemetryPIIProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ private void ModifyItem(ITelemetry item)

public virtual Route GetCurrentRoute()
{
return RouteTable.Routes.GetRouteData(new HttpContextWrapper(HttpContext.Current)).Route as Route;
if (HttpContext.Current == null)
{
return null;
}

return RouteTable.Routes.GetRouteData(new HttpContextWrapper(HttpContext.Current))?.Route as Route;
}
}
}

0 comments on commit caa82d0

Please sign in to comment.