Fixes very strange issue of FirstOrDefault not actually returning 'null' when it is actually null, never seen anything like it and
PropertyType is not a value type so should be null. real strange.
This commit is contained in:
@@ -77,6 +77,10 @@ namespace Umbraco.Core
|
||||
{
|
||||
var result = applicationContext.Services.ContentTypeService.GetContentType(docTypeAlias);
|
||||
if (result == null) return Guid.Empty;
|
||||
if (!result.PropertyTypes.Any(x => x.Alias.InvariantEquals(propertyAlias)))
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
var property = result.PropertyTypes.FirstOrDefault(x => x.Alias.InvariantEquals(propertyAlias));
|
||||
if (property == null) return Guid.Empty;
|
||||
return property.DataTypeId;
|
||||
|
||||
Reference in New Issue
Block a user