From 39ee22cbd69f9d5f385dfd0c78e5e8910a7cd887 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 16 Jul 2014 13:41:02 +1000 Subject: [PATCH] fixes a single vs first check with render route handler when there might be duplicate routes assigned to a controller --- src/Umbraco.Web/Mvc/RenderRouteHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs index 04ae377027..0d0e012f1a 100644 --- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs @@ -228,8 +228,9 @@ namespace Umbraco.Web.Mvc // If more than one route is found, find one with a matching action if (surfaceRoutes.Count() > 1) { - surfaceRoute = surfaceRoutes.SingleOrDefault(x => - x.Defaults["action"].ToString().InvariantEquals(postedInfo.ActionName)); + surfaceRoute = surfaceRoutes.FirstOrDefault(x => + x.Defaults["action"] != null && + x.Defaults["action"].ToString().InvariantEquals(postedInfo.ActionName)); } else {