From 261a6af60a4f2bc46d52da9e24ee5af9bdfb4920 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Thu, 4 Oct 2012 21:06:32 +0500 Subject: [PATCH] Fixes issue when xml file is corrupt and no doc type is registered, the mvc controller factory throws an exception. --- src/Umbraco.Web/Mvc/RenderControllerFactory.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Umbraco.Web/Mvc/RenderControllerFactory.cs b/src/Umbraco.Web/Mvc/RenderControllerFactory.cs index 2934bc7b56..56270ea36e 100644 --- a/src/Umbraco.Web/Mvc/RenderControllerFactory.cs +++ b/src/Umbraco.Web/Mvc/RenderControllerFactory.cs @@ -2,6 +2,7 @@ using System; using System.Web.Mvc; using System.Web.Routing; using System.Web.SessionState; +using Umbraco.Core; namespace Umbraco.Web.Mvc { @@ -97,6 +98,10 @@ namespace Umbraco.Web.Mvc public new Type GetControllerType(RequestContext requestContext, string controllerName) { + if (controllerName.IsNullOrWhiteSpace()) + { + return null; + } return base.GetControllerType(requestContext, controllerName); } }