fixed some potential crashes in datatype lookups and a keyalreadyexists exception in datatype lookup
This commit is contained in:
@@ -396,7 +396,10 @@ namespace umbraco.MacroEngines
|
||||
//special casing for true/false properties
|
||||
//int/decimal are handled by ConvertPropertyValueByDataType
|
||||
//fallback is stringT
|
||||
|
||||
if (n.NodeTypeAlias == null && data.Alias == null)
|
||||
{
|
||||
throw new ArgumentNullException("No node alias or property alias available. Unable to look up the datatype of the property you are trying to fetch.");
|
||||
}
|
||||
Guid dataType = ContentType.GetDataType(n.NodeTypeAlias, data.Alias);
|
||||
|
||||
if (RazorDataTypeModelTypes == null)
|
||||
|
||||
@@ -193,12 +193,17 @@ namespace umbraco.cms.businesslogic
|
||||
}
|
||||
finally
|
||||
{
|
||||
reader.Close();
|
||||
if (reader != null)
|
||||
{
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
|
||||
//add to cache
|
||||
_propertyTypeCache.Add(key, controlId);
|
||||
|
||||
if (!_propertyTypeCache.ContainsKey(key))
|
||||
{
|
||||
_propertyTypeCache.Add(key, controlId);
|
||||
}
|
||||
return controlId;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user