Fixes: U4-2711 DAMP throws unknown exception on image upload with image cropper

This commit is contained in:
Sebastiaan Janssen
2013-08-30 10:40:29 +02:00
parent adb059e0da
commit 3a4a6579d3
2 changed files with 5 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ namespace Umbraco.Core.Models
//This seems to fail during testing
//SD: With the new null checks below, this shouldn't fail anymore.
var dt = property.PropertyType.DataType(property.Id, dataTypeService);
if (dt != null && dt.Data != null)
if (dt != null && dt.Data != null && dt.Data.Value != null)
{
//We've already got the value for the property so we're going to give it to the
// data type's data property so it doesn't go re-look up the value from the db again.

View File

@@ -8,14 +8,14 @@ namespace umbraco.editorControls.imagecropper
public override XmlNode ToXMl(XmlDocument data)
{
if (Value.ToString() != "") {
XmlDocument xd = new XmlDocument();
if (Value != null && Value.ToString() != "")
{
var xd = new XmlDocument();
xd.LoadXml(Value.ToString());
return data.ImportNode(xd.DocumentElement, true);
} else {
return base.ToXMl(data);
}
return base.ToXMl(data);
}
}
}