public void Do()
{
var type = globalDataList.GatheredTypes[typeIndex];
+ if (null == type)
+ {
+ throw new Exception($"Type of index {typeIndex} is null");
+ }
+
var field = type.GetField(fi => fi.Name == propertyName && fi.IsStatic && fi.IsPublic);
if (null == field)
{
field = type.GetField(fi => fi.Name == propertyName && fi.IsStatic && !fi.IsPublic);
}
- globalDataList.GatheredBindableProperties.Add(field.GetValue(null) as BindableProperty);
+ if (null != field && field.GetValue(null) is BindableProperty value)
+ {
+ globalDataList.GatheredBindableProperties.Add(value);
+ }
}
private int typeIndex;