Corrected an issue related to the upload field when a Document without any files uploaded was deleted

This commit is contained in:
Morten Christensen
2013-02-26 14:52:33 -01:00
parent bb2f3a1732
commit 0a88ba05c8

View File

@@ -368,7 +368,7 @@ namespace Umbraco.Core.Persistence.Repositories
//Loop through properties to check if the content contains images/files that should be deleted
foreach (var property in entity.Properties)
{
if (property.PropertyType.DataTypeId == uploadFieldId &&
if (property.PropertyType.DataTypeId == uploadFieldId && property.Value != null &&
string.IsNullOrEmpty(property.Value.ToString()) == false
&& fs.FileExists(IOHelper.MapPath(property.Value.ToString())))
{