Don't do a ToString() in a IsNullOrEmpty..

This commit is contained in:
Sebastiaan Janssen
2014-05-28 16:37:16 +02:00
parent b42d0bc17e
commit 92ef071883

View File

@@ -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<MediaFileSystem>();
//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;