From 9ea077830bc4216b2a79be36e2c290871bd0278f Mon Sep 17 00:00:00 2001 From: Carl Woodhouse Date: Thu, 7 Dec 2017 20:07:49 +0000 Subject: [PATCH] Fixed the image profiler manager returning profile paths even when the image creation has failed (#7901) --- .../Services/ImageProfileManager.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs index 6284358fb..cc5ec742b 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs +++ b/src/Orchard.Web/Modules/Orchard.MediaProcessing/Services/ImageProfileManager.cs @@ -131,13 +131,12 @@ namespace Orchard.MediaProcessing.Services { // to handle cross machines concurrency lock (String.Intern(path)) { using (var image = GetImage(path)) { + if (image == null) { + return null; + } var filterContext = new FilterContext { Media = image, FilePath = _storageProvider.Combine("_Profiles", FormatProfilePath(profileName, System.Web.HttpUtility.UrlDecode(path))) }; - if (image == null) { - return filterContext.FilePath; - } - var tokens = new Dictionary(); // if a content item is provided, use it while tokenizing if (contentItem != null) {