Fixes: U4-2711 DAMP throws unknown exception on image upload with image cropper
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user