Closed Farfi55 closed 1 year ago
maybe related, when generating new Template a NullReferenceException is thrown inside RetrievePropertyByType
because `currentType' is null.
from my debugging I think this problem has origin inside RetrieveProperty
since it can't find the type of the property
private static void RetrievePropertyByType(string currentProperty, ref Type currentType)
{
// NullReferenceException here
MemberInfo[] members = currentType.GetMember(currentProperty, Utility.BindingAttr);
if (members.Length > 0)
{
FieldOrProperty fieldOrProperty = new FieldOrProperty(members[0]);
currentType = fieldOrProperty.Type();
}
else
{
currentType = null;
}
}
I don't think it's related. Can you open a new issue describing the sensor that causes the nullreference please?
Example generated code:
in this case
FirstKitchenObject1
should also be checked for null and if so handle it similarly as whenName2
is null