From 92ef071883e0535be6602cf666777fb75ed4801f Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 28 May 2014 16:37:16 +0200 Subject: [PATCH] Don't do a ToString() in a IsNullOrEmpty.. --- .../PropertyEditors/ImageCropperPropertyValueEditor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs index 72b5aa1e62..7c84ff7026 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs @@ -51,7 +51,7 @@ namespace Umbraco.Web.PropertyEditors JObject oldJson = null; //get the old src path - if (string.IsNullOrEmpty(currentValue.ToString()) == false) + if (currentValue != null && string.IsNullOrEmpty(currentValue.ToString()) == false) { try { @@ -86,7 +86,7 @@ namespace Umbraco.Web.PropertyEditors var fs = FileSystemProviderManager.Current.GetFileSystemProvider(); //if we have an existing file, delete it - if (!string.IsNullOrEmpty(oldFile)) + if (string.IsNullOrEmpty(oldFile) == false) fs.DeleteFile(fs.GetRelativePath(oldFile), true); else oldFile = string.Empty;