From 1aec0e1d9c19ec21a18e99cff863ab7368c33a58 Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Mon, 8 Apr 2019 07:24:56 +0200 Subject: [PATCH] Fix exception types as per review --- src/Umbraco.Web/Editors/ContentTypeController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index f95a4da30e..e2a1e54571 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -327,13 +327,13 @@ namespace Umbraco.Web.Editors var contentType = Services.ContentTypeService.Get(id); if (contentType == null) { - throw new NullReferenceException("No content type found with id " + id); + throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound, "No content type found with id " + id)); } var template = CreateTemplateForContentType(contentType.Alias, contentType.Name); if (template == null) { - throw new NullReferenceException("Could not create default template for content type with id " + id); + throw new InvalidOperationException("Could not create default template for content type with id " + id); } return Mapper.Map(template);