Only log not found blocks
This commit is contained in:
@@ -140,7 +140,8 @@ public class Reader {
|
|||||||
blockOffset += t.GetCustomAttribute<DNAClassAttribute>()!.Size;
|
blockOffset += t.GetCustomAttribute<DNAClassAttribute>()!.Size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var obj in objects) {
|
for(int i=0; i<Objects.Count; i++) {
|
||||||
|
var obj = Objects.ElementAt(i);
|
||||||
// for each converted object
|
// for each converted object
|
||||||
// get the fields of the object
|
// get the fields of the object
|
||||||
FieldInfo[] fieldInfo = obj.Value.GetType().GetFields();
|
FieldInfo[] fieldInfo = obj.Value.GetType().GetFields();
|
||||||
@@ -167,7 +168,15 @@ public class Reader {
|
|||||||
{
|
{
|
||||||
newobj = ActivateInstance(f.FieldType);
|
newobj = ActivateInstance(f.FieldType);
|
||||||
if (newobj != null) {
|
if (newobj != null) {
|
||||||
|
try
|
||||||
|
{
|
||||||
FillObject(addr, ref newobj, f.FieldType.GetFields());
|
FillObject(addr, ref newobj, f.FieldType.GetFields());
|
||||||
|
} catch (Exception e)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Error while filling object {f.FieldType.Name}: {e}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
f.SetValue(obj.Value, newobj);
|
f.SetValue(obj.Value, newobj);
|
||||||
} // should never happen
|
} // should never happen
|
||||||
else throw new NotSupportedException($"Type \"{f.FieldType}\" is unknown");
|
else throw new NotSupportedException($"Type \"{f.FieldType}\" is unknown");
|
||||||
|
|||||||
Reference in New Issue
Block a user