Fixes issue with ensuring properties on entities when a new property type has been created - but if the property type doesn't have an id, we should ignore it.

This commit is contained in:
Shannon
2014-02-19 17:27:08 +11:00
parent d339e7c814
commit e2d5fbf545

View File

@@ -117,7 +117,7 @@ namespace Umbraco.Core.Persistence.Repositories
var propertyFactory = new PropertyFactory(contentType, versionId, id, createDate, updateDate);
var properties = propertyFactory.BuildEntity(propertyDataDtos).ToArray();
var newProperties = properties.Where(x => x.HasIdentity == false);
var newProperties = properties.Where(x => x.HasIdentity == false && x.PropertyType.HasIdentity);
foreach (var property in newProperties)
{
var propertyDataDto = new PropertyDataDto { NodeId = id, PropertyTypeId = property.PropertyTypeId, VersionId = versionId };