|
@@ -248,10 +248,20 @@ namespace InABox.Core
|
|
|
private static void CheckProperties(Type type)
|
|
|
{
|
|
|
var entityName = type.EntityName();
|
|
|
- var props = _properties.GetValueOrDefault(entityName);
|
|
|
- var hasprops = props?.Any(x => x.Value is StandardProperty) == true;
|
|
|
- if (type.IsSubclassOf(typeof(BaseObject)) && !hasprops)
|
|
|
- RegisterProperties(type);
|
|
|
+ try
|
|
|
+ {
|
|
|
+ var props = _properties.GetValueOrDefault(entityName);
|
|
|
+ var hasprops = props?.ToArray().Any(x => x.Value is StandardProperty) == true;
|
|
|
+ if (type.IsSubclassOf(typeof(BaseObject)) && !hasprops)
|
|
|
+ RegisterProperties(type);
|
|
|
+ }
|
|
|
+ catch (Exception e)
|
|
|
+ {
|
|
|
+ // This seems to be an intermittent error "Collection has been modified" when checking if the Dictionary has been populated already
|
|
|
+ // I've added a .ToArray() to concretise the list, but who knows?
|
|
|
+ Logger.Send(LogType.Error,"",$"Error Checking Properties for Type: {entityName}\n{e.Message}\n{e.StackTrace}");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static IEnumerable<IProperty> Properties(Type type)
|